null(n)

πŸ“¦ version 2.3, in fedora 43, fedora 44

✨ null(n) ✨

okay bestie, welcome to the null manual page πŸ’– this one lives in the memchan family, so it's all about channels, and it's short and sweet. buckle up πŸŽ€


🌈 NAME 🌈

null β€” create and manipulate null channels πŸ•³οΈβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

package require Tcl

package require memchan

null

πŸ’… DESCRIPTION πŸ’…

heads up, bestie: the command described right here is only available in a not-yet released version of the package. use the CVS to get the sources. no cap. 🫠

null creates a null channel, and a null channel literally absorbs everything you write into it. that's its whole thing. it's giving black hole but make it i/o πŸ•³οΈπŸ’–

Reading from it is not possible β€” or rather, it will always return zero bytes. so like, you can try, and it'll just hand you nothing. iconic behaviour tbh.

These channels are essentially Tcl-specific variants of the null device for unixoid operating systems (/dev/null). you know the vibe. 🫢

Transferring the generated channel between interpreters is possible but does not make much sense. like sure, you could, bestie, but why 😭


✨ OPTIONS ✨

Memory channels created by null provide one additional option to set or query. one. singular. the whole menu. πŸ’…

  • -delay ?milliseconds? β€” okay so, a null channel is always writable and readable (the manpage really said that, we'll get to it πŸ‘€). this means that all fileevent-handlers will fire continuously. to avoid starvation of other event sources, the events raised by this channel type have a configurable delay. this option is set in milliseconds and defaults to 5. ⏱️✨

🫠 the plot twist 🫠

A null channel is always writable and never readable. yes bestie, the page says both things, we're just relaying the lore, don't shoot the messenger πŸ’€

This means that:

  • a writable fileevent-handler will fire continuously πŸ”₯
  • a readable fileevent-handler will never fire at all πŸ¦‹

The exception to that last one? only the destruction of the channel, which will cause the delivery of an eof event to a readable handler. so it's one final goodbye event, and then nothing. periodt. πŸ˜­πŸ’”


πŸ‘‘ SEE ALSO πŸ‘‘

  • fifo
  • fifo2
  • memchan
  • random
  • zero

go read those too, bestie, they're the whole friend group 🌸


πŸŽ€ KEYWORDS πŸŽ€

  • channel
  • i/o
  • in-memory channel
  • null

Copyright (c) 1996-2003 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page, bestie!! 🫢✨ this was Memory channels version 2.2, null(n), and yeah β€” that footer date energy is giving vintage but the knowledge is timeless πŸ’…πŸ“š mwah, go forth and write into the void πŸ•³οΈπŸ’–

πŸ“¦ where this page comes from