tcl::chan::fifo2(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ tcl::chan::fifo2 ✨

okay bestie, you're in the tcl::chan::fifo2 page of the Reflected/virtual channel support manual (that's the 3tcl section, iykyk) πŸ’… and it's literally all about in-memory interconnected fifo channels. no cap. let's go πŸ¦‹


🌸 NAME 🌸

tcl::chan::fifo2 β€” in-memory interconnected fifo channels πŸŽ€


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require TclOO

package require tcl::chan::events ?1.1?

package require tcl::chan::halfpipe ?1.1?

package require tcl::chan::fifo2 ?1.1?

::tcl::chan::fifo2

like, that's the whole vibe right there πŸ’–


πŸ’œ DESCRIPTION πŸ’œ

so the tcl::chan::fifo2 package hands you a command that creates pairs of channels that live purely in memory 🧠✨ and are connected to each other in a fifo manner. what you write into one half of the pair, you can read out of the other half β€” in the same order. first in, first out, periodt πŸ’…

one particular application for this is communication between threads, where you move one half of the pair over to the thread you want to talk to πŸ“¬πŸ«Ά

and like, this is equivalent to the fifo2 channels that the Memchan package provides β€” except this one is written in pure Tcl, not C πŸ‘‘. on the other hand, Memchan is usable with Tcl 8.4 and before, whereas this package requires Tcl 8.5 or higher, and TclOO. so, tradeoffs, bestie 😭

also, the internal TclOO class implementing the channel handler is a sub-class of the tcl::chan::events framework 🌈


πŸŽ€ API πŸŽ€

  • ::tcl::chan::fifo2 β€” this command creates a new connected pair of fifo channels and returns their handles, as a list containing two elements πŸ“βœ¨

πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

ngl, this document β€” and the package it describes β€” will undoubtedly contain bugs and other problems πŸ™ˆ. please report such in the category virtchannel of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist]. and please also report any ideas for enhancements you may have for either the package and/or the documentation πŸ’Œ

when proposing code changes, please provide unified diffs, i.e. the output of diff -u 🧚

note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar πŸ‘‘


🌟 KEYWORDS 🌟

connected fifos, fifo, in-memory channel, inter-thread communication, reflected channel, tip 219, virtual channel πŸ¦‹


🌈 CATEGORY 🌈

Channels πŸ“‘


Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net> πŸ’œ


okay that's the whole page bestie, go build something iconic with it 🫢✨

and that's a wrap on this little chat β€” this was tcllib, version 1.1, of the tcl::chan::fifo2(3tcl) page, slay πŸ’…πŸŒΈ

πŸ“¦ where this page comes from