tcl::chan::fifo2(n)
π tcl::chan::fifo2(n) π
okay bestie, so this is a page from the Reflected/virtual channel support corner of the tcllib manual, and it's about making channels that literally only exist in your computer's vibes (memory) π§ β¨
β¨ 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
β¨ DESCRIPTION β¨
So the tcl::chan::fifo2 package gives you a command that makes pairs of channels which live purely in memory and are connected to each other in a fifo manner. no cap. π
What gets written to one half of the pair can be read from the other half, in the same order. it's giving "walkie-talkie but make it channels". π»
One particular application for this is communication between threads, with one half of the pair moved to the thread you wanna talk to. slay.
This is equivalent to the fifo2 channels provided by the package Memchan, except that this one is written in pure Tcl, not C. π¦
On the other hand β and this is the tradeoff bestie, listen β Memchan is usable with Tcl 8.4 and before, whereas this package requires Tcl 8.5 or higher, and TclOO. so like, know your version before you commit, fr fr. π
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. two handles, one list, iconic. π«Ά
π BUGS, IDEAS, FEEDBACK π
This document, and the package it describes, will undoubtedly contain bugs and other problems. not me being honest about it π Please report such in the category virtchannel of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist](http://core.tcl.tk/tcllib/reportlist). Please also report any ideas for enhancements you may have for either package and/or documentation. we love a feedback moment π
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 π
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page bestie, no skips, no cuts π«Ά this one came from tcllib, version 1.1, and it's the tcl::chan::fifo2(n) page β go make some in-memory fifos, you got this ππΈβ¨
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms