Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Client header point tip (m :: Type -> Type) t = Client {
- rollbackward :: point -> tip -> m (Either t (Client header point tip m t))
- rollforward :: header -> m (Either t (Client header point tip m t))
- points :: [point] -> m (Either t (Client header point tip m t))
- chainSyncClientPipelinedMax :: forall header (m :: Type -> Type) a. (HasHeader header, MonadSTM m) => Word16 -> StrictTVar m (Chain header) -> Client header (Point header) (Tip header) m a -> ChainSyncClientPipelined header (Point header) (Tip header) m a
- chainSyncClientPipelinedMin :: forall header (m :: Type -> Type) a. (HasHeader header, MonadSTM m) => Word16 -> StrictTVar m (Chain header) -> Client header (Point header) (Tip header) m a -> ChainSyncClientPipelined header (Point header) (Tip header) m a
- chainSyncClientPipelinedLowHigh :: forall header (m :: Type -> Type) a. (HasHeader header, MonadSTM m) => Word16 -> Word16 -> StrictTVar m (Chain header) -> Client header (Point header) (Tip header) m a -> ChainSyncClientPipelined header (Point header) (Tip header) m a
Documentation
data Client header point tip (m :: Type -> Type) t Source #
Client | |
|
chainSyncClientPipelinedMax Source #
:: forall header (m :: Type -> Type) a. (HasHeader header, MonadSTM m) | |
=> Word16 | maximal number of outstanding requests |
-> StrictTVar m (Chain header) | |
-> Client header (Point header) (Tip header) m a | |
-> ChainSyncClientPipelined header (Point header) (Tip header) m a |
A pipelined chain-sync client that sends eagerly up omax
pipelined
request and then collects all responses and starts over again. This
presents maximum pipelining and presents minimum choice to the environment
(drivers).
This client is only useful in tests and reference implementation: it is using mock representation of a chain.
If omax
is equal to 3 the communication will look like (if the client is
far from server's tip; pipelining is presented with long pauses to
ilustrate when messages will be collected).
'MsgFindIntersect' ↘ │ ╲ │ │ ╲ │ │ ╲ │ │ ╲ │ ↙ 'MsgIntersectFound' or 'MsgIntersectNotFound' │ ╱ │ │ ╱ │ │ ╱ │ 'MsgRequestNext' ↘ │ ╱ │ │ ╲ │ │ ╲ │ │ ╲ │ │ ╲ │ ↙ 'MsgRollForward' or 'MsgRollBackward' │ ╱ │ 'MsgRequestNext' ↘ │ ╱ │ │ ╲╱ │ │ ╱╲ │ │ ╲ │ │ ╲ │ ↙ 'MsgRollForward' or 'MsgRollBackward' │ ╱ │ │ ╱ │ 'MsgRequestNext' ↘ │ ╲╱ │ │ ╱╲ │ 'Collect' ↙ │╱ ╲ │ 'MsgRequestNext' ↘ │╲ │ ┆ ┆ ┆ ┆ 'Collect' ↙ │╱ ╲ │ │ ╲ │ ↙ 'MsgRollForward' or 'MsgRollBackward' │ ╱ │ │ ╱ │ │ ╱ │ 'Collect' ↙ │ ╱ │ │ │
chainSyncClientPipelinedMin Source #
:: forall header (m :: Type -> Type) a. (HasHeader header, MonadSTM m) | |
=> Word16 | maximal number of outstanding requests |
-> StrictTVar m (Chain header) | |
-> Client header (Point header) (Tip header) m a | |
-> ChainSyncClientPipelined header (Point header) (Tip header) m a |
A pipelined chain-sycn client that pipelines at most omax
requests and
always tries to collect any replies as soon as they are available. This
keeps pipelining to bare minimum, and gives maximum choice to the
environment (drivers).
If omax
is equal to 3 the communication will look like (if the client is
far from server's tip; pipelining is presented with long pauses to
ilustrate when messages will be collected).
'MsgFindIntersect' ↘ │ ╲ │ │ ╲ │ │ ╲ │ │ ╲ │ ↙ 'MsgIntersectFound' or 'MsgIntersectNotFound' │ ╱ │ │ ╱ │ │ ╱ │ 'MsgRequestNext' ↘ │ ╱ │ │ ╲ │ │ ╲ │ │ ╲ │ │ ╲ │ ↙ 'MsgRollForward' or 'MsgRollBackward' │ ╱ │ 'MsgRequestNext' ↘ │ ╱ │ │ ╲╱ │ 'Collect' ↙ │ ╱╲ │ │ ╲ │ │ ╲ │ ↙ 'MsgRollForward' or 'MsgRollBackward' │ ╱ │ │ ╱ │ 'MsgRequestNext' ↘ │ ╲╱ │ │ ╱╲ │ 'Collect' ↙ │ ╲ │ │ ╲ │ ↙ 'MsgRollForward' or 'MsgRollBackward' │ ╱ │ │ ╱ │ │ ╱ │ 'Collect' ↙ │ ╱ │ │ │