tcl::chan::events(n)
π tcl::chan::events(n) β Reflected/virtual channel support π
okay bestie, welcome to the manual page for tcl::chan::events, straight outta the Reflected/virtual channel support manual. she's a TclOO class, she's iconic, and she's about to make your event-driven IO life so much easier. grab a boba, we're doing this π§β¨
β¨ NAME β¨
tcl::chan::events β event support for reflected/virtual channels π¦
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require TclOO
package require tcl::chan::core ?1.1?
package require tcl::chan::events ?1.1?
::tcl::chan::events objectName
objectName finalize thechannel
objectName watch thechannel eventmask
objectName allow eventname...
objectName disallow eventname...
β¨ DESCRIPTION β¨
so the tcl::chan::events package hands you a TclOO class that implements all the common behaviour that, like, virtually every reflected or virtual channel supporting event driven IO needs. it's giving "shared DNA" fr fr. she's a sub-class of tcl::chan::core and inherits literally all of her behaviour from it π
this class expects to be used either as the superclass of a concrete channel class, or to be mixed into one. either way, she eats. π
β¨ CLASS API β¨
::tcl::chan::events objectNameβ this command creates a brand new channel event core object, plus a global Tcl command attached to it whose name isobjectName. that command is your girl for invoking various operations on the object, and all of them are described down in the Instance API section. π
β¨ INSTANCE API β¨
the API of channel event core instances gives you only four methods β two of them match up with channel handler commands (for reference, see TIP 219 [http:/tip.tcl.tk/219]), and the other two are for sub-classes to control event generation. the first pair expects to be called from whichever object instance the channel event core was made a part of. no cap. π«Ά
objectName finalize thechannelβ this method implements the standard behaviour for thefinalizemethod of channel handlers. it overrides the behaviour inherited fromtcl::chan::core, and on top of that it disables any and all event generation before destroying itself. dramatic exit, honestly iconic. πobjectName watch thechannel eventmaskβ this method implements the standard behaviour for thewatchmethod of channel handlers. the IO system calls it whenever the interest in events changes, and it updates the instance state to activate and/or suppress the generation of the events of (non-)interest. very much a vibe check on what's wanted. π₯objectName allow eventname...objectName disallow eventname...β these two methods are exported to sub-classes so that their instances can notify their event core about the events the channel they implement can (allow) or cannot (disallow) generate. combine that with the info about events requested by Tcl's IO system coming in through thewatchmethod, and the event core can figure out which events it should (not) generate and act accordingly. teamwork makes the dream work, bestie π
β¨ BUGS, IDEAS, FEEDBACK β¨
this document, and the package it describes, will undoubtedly contain bugs and other problems. not me being humble, it's just facts π 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. we want all of it. π
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. that's the move. π
β¨ KEYWORDS β¨
event management, 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! this was tcl::chan::events(n), version 1.1 from tcllib, and she ate every single time π
β¨ go forth and generate events responsibly ππ¦π
π¦ 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