broadcast-chan

Broadcast channel type that avoids 0 reader space leaks.

https://github.com/merijn/broadcast-chan

Version on this page:0.1.1@rev:1
LTS Haskell 22.43:0.2.1.2@rev:2
Stackage Nightly 2023-12-26:0.2.1.2@rev:2
Latest on Hackage:0.2.1.2@rev:2

See all snapshots broadcast-chan appears in

BSD-3-Clause licensed by Merijn Verstraaten
Maintained by Merijn Verstraaten
This version can be pinned in stack with:broadcast-chan-0.1.1@sha256:4417ac845d09ef7168bda2cfd9d32af42f4864a356c0a9e31ed0e7957e6b750d,2052

Module documentation for 0.1.1

Depends on 1 package(full list with versions):

A variation of Control.Concurrent.Chan from base, which allows to the easy creation of broadcast channels without the space-leaks that may arise from using Control.Concurrent.Chan.dupChan. The Control.Concurrent.Chan.Chan type from Control.Concurrent.Chan consists of both a read and write end. This presents a problem when one wants to have a broadcast channel that, at times, has zero listeners. To write to a Control.Concurrent.Chan.Chan there must always be a read end and this read end will hold ALL messages alive until read. The simple solution applied in this module is to separate read and write ends. As a result, any messages written to the write end can be immediately garbage collected if there are no active read ends, avoding space leaks.