tcl::chan::events(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– 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 is objectName. 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 the finalize method of channel handlers. it overrides the behaviour inherited from tcl::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 the watch method 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 the watch method, 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 (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