Copyright | (C) 2016-2025 David M. Johnson |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <code@dmj.io> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Miso.Concurrent
Contents
Description
Syncrhonization primitives
Synchronization primitive for event loop
type Mailbox = TChan Mail Source #
Publish / Subscribe concurrency primitive
A Mailbox
is a broadcast TChan
that can express the following concurrency patterns
- Broadcast (one-to-all, 1:n)
- Multicast (one-to-many, 1:n)
- Unicast (one-to-one, 1:1)
All the above are supported as well in a bidirectional setting.
- Bidirectional (multicast broadcast unicast) (n:m)
Practically this pattern resembles cloud notifcation services like
- Amazon SNS
- Google Pub/Sub
See 'examplescomponentsMain.hs' for example usage.