Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype BlockFetchClient block point m a = BlockFetchClient {
- runBlockFetchClient ∷ m (BlockFetchRequest block point m a)
- data BlockFetchRequest block point m a where
- SendMsgRequestRange ∷ ChainRange point → BlockFetchResponse block m a → BlockFetchClient block point m a → BlockFetchRequest block point m a
- SendMsgClientDone ∷ a → BlockFetchRequest block point m a
- data BlockFetchResponse block m a = BlockFetchResponse {
- handleStartBatch ∷ m (BlockFetchReceiver block m)
- handleNoBlocks ∷ m ()
- data BlockFetchReceiver block m = BlockFetchReceiver {
- handleBlock ∷ block → m (BlockFetchReceiver block m)
- handleBatchDone ∷ m ()
- blockFetchClientPeer ∷ ∀ block point m a. Monad m ⇒ BlockFetchClient block point m a → Peer (BlockFetch block point) AsClient BFIdle m a
- data BlockFetchClientPipelined block point m a where
- BlockFetchClientPipelined ∷ BlockFetchSender Z c block point m a → BlockFetchClientPipelined block point m a
- data BlockFetchSender n c block point m a where
- SendMsgRequestRangePipelined ∷ ChainRange point → c → (Maybe block → c → m c) → BlockFetchSender (S n) c block point m a → BlockFetchSender n c block point m a
- CollectBlocksPipelined ∷ Maybe (BlockFetchSender (S n) c block point m a) → (c → BlockFetchSender n c block point m a) → BlockFetchSender (S n) c block point m a
- SendMsgDonePipelined ∷ a → BlockFetchSender Z c block point m a
- blockFetchClientPeerPipelined ∷ ∀ block point m a. Monad m ⇒ BlockFetchClientPipelined block point m a → PeerPipelined (BlockFetch block point) AsClient BFIdle m a
- blockFetchClientPeerSender ∷ ∀ n block point c m a. Monad m ⇒ BlockFetchSender n c block point m a → PeerSender (BlockFetch block point) AsClient BFIdle n c m a
Documentation
newtype BlockFetchClient block point m a Source #
Block fetch client type for requesting ranges of blocks and handling responses.
BlockFetchClient | |
|
data BlockFetchRequest block point m a where Source #
SendMsgRequestRange ∷ ChainRange point → BlockFetchResponse block m a → BlockFetchClient block point m a → BlockFetchRequest block point m a | Request a chain range, supply handler for incoming blocks and a continuation. |
SendMsgClientDone ∷ a → BlockFetchRequest block point m a | Client terminating the block-fetch protocol. |
data BlockFetchResponse block m a Source #
BlockFetchResponse | |
|
data BlockFetchReceiver block m Source #
Blocks are streamed and block receiver will handle each one when it comes, it also needs to handle errors sent back from the server.
BlockFetchReceiver | |
|
blockFetchClientPeer ∷ ∀ block point m a. Monad m ⇒ BlockFetchClient block point m a → Peer (BlockFetch block point) AsClient BFIdle m a Source #
data BlockFetchClientPipelined block point m a where Source #
A BlockFetch client designed for running the protcol in a pipelined way.
BlockFetchClientPipelined ∷ BlockFetchSender Z c block point m a → BlockFetchClientPipelined block point m a | A |
data BlockFetchSender n c block point m a where Source #
A BlockFetchSender
with n
outstanding stream of block bodies.
SendMsgRequestRangePipelined ∷ ChainRange point → c → (Maybe block → c → m c) → BlockFetchSender (S n) c block point m a → BlockFetchSender n c block point m a | Send a |
CollectBlocksPipelined ∷ Maybe (BlockFetchSender (S n) c block point m a) → (c → BlockFetchSender n c block point m a) → BlockFetchSender (S n) c block point m a | Collect the result of a previous pipelined receive action |
SendMsgDonePipelined ∷ a → BlockFetchSender Z c block point m a | Termination of the block-fetch protocol. |
blockFetchClientPeerPipelined ∷ ∀ block point m a. Monad m ⇒ BlockFetchClientPipelined block point m a → PeerPipelined (BlockFetch block point) AsClient BFIdle m a Source #
blockFetchClientPeerSender ∷ ∀ n block point c m a. Monad m ⇒ BlockFetchSender n c block point m a → PeerSender (BlockFetch block point) AsClient BFIdle n c m a Source #