HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulenetwork-mux-0.11.0.0Haskell2010

Network.Mux.Ingress

  • 1 value

Ingress Path

                 ●
                 │
                 │ ByteStrings
                 │
        ░░░░░░░░░▼░░░░░░░░░
        ░┌───────────────┐░
        ░│ Bearer.read() │░ Mux Bearer implementation (Socket, Pipes, etc.)
        ░└───────────────┘░
        ░░░░░░░░░│░░░░░░░░░
                ░│░         SDUs
        ░░░░░░░░░▼░░░░░░░░░
        ░┌───────────────┐░
        ░│     demux     │░ For a given Mux Bearer there is a single demux
        ░└───────┬───────┘░ thread reading from the underlying bearer.
        ░░░░░░░░░│░░░░░░░░░
                ░│░
       ░░░░░░░░░░▼░░░░░░░░░░
       ░ ╭────┬────┬─────╮ ░ There is a limited queue (in bytes) for each mode
       ░ │    │    │     │ ░ (responder/initiator) per miniprotocol. Overflowing
       ░ ▼    ▼    ▼     ▼ ░ a queue is a protocol violation and a
       ░│  │ │  │ │  │ │  │░ IngressQueueOverRun exception is thrown
       ░│ci│ │  │ │bi│ │br│░ and the bearer torn down.
       ░│ci│ │cr│ │bi│ │br│░
       ░└──┘ └──┘ └──┘ └──┘░ Every ingress queue has a dedicated thread which will
       ░░│░░░░│░░░░│░░░░│░░░ read application encoded data from its queue.
         │    │    │    │
          application data
         │    │    │    │
         ▼    │    │    ▼
┌───────────┐ │    │  ┌───────────┐
│ muxDuplex │ │    │  │ muxDuplex │
│ Initiator │ │    │  │ Responder │
│ ChainSync │ │    │  │ BlockFetch│
└───────────┘ │    │  └───────────┘
              ▼    ▼
   ┌───────────┐  ┌───────────┐
   │ muxDuplex │  │ muxDuplex │
   │ Responder │  │ Initiator │
   │ ChainSync │  │ BlockFetch│
   └───────────┘  └───────────┘