Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype BlockFetchClient block point (m :: Type -> Type) a = BlockFetchClient {
- runBlockFetchClient :: m (BlockFetchRequest block point m a)
- data BlockFetchRequest block point (m :: Type -> Type) a where
- SendMsgRequestRange :: forall point block (m :: Type -> Type) a. ChainRange point -> BlockFetchResponse block m a -> BlockFetchClient block point m a -> BlockFetchRequest block point m a
- SendMsgClientDone :: forall a block point (m :: Type -> Type). a -> BlockFetchRequest block point m a
- data BlockFetchResponse block (m :: Type -> Type) (a :: k) = BlockFetchResponse {
- handleStartBatch :: m (BlockFetchReceiver block m)
- handleNoBlocks :: m ()
- data BlockFetchReceiver block (m :: Type -> Type) = BlockFetchReceiver {
- handleBlock :: block -> m (BlockFetchReceiver block m)
- handleBatchDone :: m ()
- blockFetchClientPeer :: forall block point (m :: Type -> Type) a. Monad m => BlockFetchClient block point m a -> Client (BlockFetch block point) 'NonPipelined ('BFIdle :: BlockFetch block point) m a
- data BlockFetchClientPipelined block point (m :: Type -> Type) a where
- BlockFetchClientPipelined :: forall c block point (m :: Type -> Type) a. BlockFetchSender 'Z c block point m a -> BlockFetchClientPipelined block point m a
- data BlockFetchSender (n :: N) c block point (m :: Type -> Type) a where
- SendMsgRequestRangePipelined :: forall point c block (m :: Type -> Type) (n :: N) a. ChainRange point -> c -> (Maybe block -> c -> m c) -> BlockFetchSender ('S n) c block point m a -> BlockFetchSender n c block point m a
- CollectBlocksPipelined :: forall (n1 :: N) c block point (m :: Type -> Type) a. Maybe (BlockFetchSender ('S n1) c block point m a) -> (c -> BlockFetchSender n1 c block point m a) -> BlockFetchSender ('S n1) c block point m a
- SendMsgDonePipelined :: forall a c block point (m :: Type -> Type). a -> BlockFetchSender 'Z c block point m a
- blockFetchClientPeerPipelined :: forall block point (m :: Type -> Type) a. Monad m => BlockFetchClientPipelined block point m a -> ClientPipelined (BlockFetch block point) ('BFIdle :: BlockFetch block point) m a
- blockFetchClientPeerSender :: forall (n :: N) block point c (m :: Type -> Type) a. Monad m => BlockFetchSender n c block point m a -> Client (BlockFetch block point) ('Pipelined n c) ('BFIdle :: BlockFetch block point) m a
Documentation
newtype BlockFetchClient block point (m :: Type -> Type) a Source #
Block fetch client type for requesting ranges of blocks and handling responses.
BlockFetchClient | |
|
data BlockFetchRequest block point (m :: Type -> Type) a where Source #
SendMsgRequestRange :: forall point block (m :: Type -> Type) a. 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 :: forall a block point (m :: Type -> Type). a -> BlockFetchRequest block point m a | Client terminating the block-fetch protocol. |
data BlockFetchResponse block (m :: Type -> Type) (a :: k) Source #
BlockFetchResponse | |
|
data BlockFetchReceiver block (m :: Type -> Type) 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 :: forall block point (m :: Type -> Type) a. Monad m => BlockFetchClient block point m a -> Client (BlockFetch block point) 'NonPipelined ('BFIdle :: BlockFetch block point) m a Source #
data BlockFetchClientPipelined block point (m :: Type -> Type) a where Source #
A BlockFetch client designed for running the protcol in a pipelined way.
BlockFetchClientPipelined :: forall c block point (m :: Type -> Type) a. BlockFetchSender 'Z c block point m a -> BlockFetchClientPipelined block point m a | A |
data BlockFetchSender (n :: N) c block point (m :: Type -> Type) a where Source #
A BlockFetchSender
with n
outstanding stream of block bodies.
SendMsgRequestRangePipelined :: forall point c block (m :: Type -> Type) (n :: N) a. 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 :: forall (n1 :: N) c block point (m :: Type -> Type) a. Maybe (BlockFetchSender ('S n1) c block point m a) -> (c -> BlockFetchSender n1 c block point m a) -> BlockFetchSender ('S n1) c block point m a | Collect the result of a previous pipelined receive action |
SendMsgDonePipelined :: forall a c block point (m :: Type -> Type). a -> BlockFetchSender 'Z c block point m a | Termination of the block-fetch protocol. |
blockFetchClientPeerPipelined :: forall block point (m :: Type -> Type) a. Monad m => BlockFetchClientPipelined block point m a -> ClientPipelined (BlockFetch block point) ('BFIdle :: BlockFetch block point) m a Source #
blockFetchClientPeerSender :: forall (n :: N) block point c (m :: Type -> Type) a. Monad m => BlockFetchSender n c block point m a -> Client (BlockFetch block point) ('Pipelined n c) ('BFIdle :: BlockFetch block point) m a Source #