tcl::chan::facade(n)

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

πŸ’– tcl::chan::facade β€” the manual, but make it make sense πŸ’–

okay bestie, sit down, hydrate, because we're talking about tcl::chan::facade β€” the facade channel from the Reflected/virtual channel support crew in tcllib. yes it's giving niche. yes it's iconic. let's go πŸ¦‹


✨ NAME ✨

tcl::chan::facade β€” Facade channel. that's the whole name, she's simple, she's elegant πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

package require Tcl 8.5 9

package require TclOO

package require logger

package require tcl::chan::core ?1.1?

package require tcl::chan::facade ?1.1?

::tcl::chan::facade chan

like, look at her. five requires and a command. main character energy fr fr ✨


🌸 DESCRIPTION 🌸

okay so the tcl::chan::facade package hands you a command that makes facades for other channels. and what is a facade, you ask? it's a channel that owns exactly one subordinate channel and just... delegates everything to it. every operation. all of them. it's the middle manager of channels, except genuinely useful πŸ’€

the big brain use case here is debugging what's happening on a channel. because like β€” sure, a virtual channel transformation could track most of the info, but it does not have access to the event-related operation. also they're only available in Tcl 8.6, so. rough.

so this channel exists: it works on Tcl 8.5, and it has access to everything going on for a channel. everything. the whole vibe check. πŸ‘‘

the intercepted actions on the channel get logged through the logger package. so yes, it's a little snitch, but a helpful one 🫢

and beyond all that, facades give you these extra channel configuration options:

  • -self β€” the TclOO object handling the facade. that's her. that's the girl.
  • -fd β€” the handle of the subordinate, i.e. the wrapped channel. the one underneath. the intern.
  • -used β€” the last time the wrapped channel was read from or written to by the facade, as per clock milliseconds. a value of 0 means the subordinate channel was not accessed at all, yet. (not even once. untouched. pristine. πŸ™ˆ)
  • -created β€” the time the facade was created, as per clock milliseconds. her birthday πŸŽ‚
  • -user β€” a free-form value identifying the user of the facade and its wrapped channel. write whatever you want in here, it's your little name tag.
⚠️ heads up bestie: out of all of those, only -user is writable. the rest are read-only. do not try it. she will not budge. πŸ’…

⭐ API ⭐

  • ::tcl::chan::facade chan β€” this command creates the facade channel around the channel you pass in as chan, and returns its handle. that's it. that's the whole API. short and slay. ✨

😭 BUGS, IDEAS, FEEDBACK 😭

ngl, this document and the package it describes will undoubtedly contain bugs and other problems. like, obviously. it's software. πŸ’€

please report such things in the category virtchannel of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist. and if you have ideas for enhancements for either the package and/or the documentation, report those too!! we want them!! 🫢

when you're proposing code changes, please provide unified diffs, i.e the output of diff -u. fr fr, that's the format.

also note: attachments are strongly preferred over inlined patches. to attach something, go to the Edit form of the ticket immediately after its creation, and then use the left-most button in the secondary navigation bar. iykyk πŸŽ€


πŸ”₯ KEYWORDS πŸ”₯

concatenation channel, reflected channel, tip 219, virtual channel


πŸ‘‘ CATEGORY πŸ‘‘

Channels


Copyright (c) 2011 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page bestie, no notes. this one came from tcllib, version 1.1, and she's filed under tcl::chan::facade(n) β€” go forth and wrap some channels, you absolute legend πŸŒˆβœ¨πŸ¦‹

πŸ“¦ where this page comes from