| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Relay.Reliable.Inbox
Description
Synopsis
- newtype Inbox a = Inbox {
- half :: ReceiverHalf a
- emptyInbox :: Inbox a
- recv :: Frame a -> Inbox a -> (Inbox a, [a])
- ackFrontier :: Inbox a -> Maybe Nat
Documentation
The receive half of one reliable session: the dual of Outbox.
It wraps a ReceiverHalf, which tracks the delivery frontier: the
highest sequence number released in order so far. Every sequence
number up to and including the frontier has been delivered to the
application; nothing above it has (out-of-order arrivals wait in the
reorder buffer until the gap fills). Inbox adds the cumulative ack
value derived from that frontier.
Constructors
| Inbox | |
Fields
| |
emptyInbox :: Inbox a Source #
Initial inbox state: nothing received, expecting sequence 1.