Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cardano.Api.ChainSync.ClientPipelined
Synopsis
- newtype ChainSyncClientPipelined header point tip (m :: Type -> Type) a = ChainSyncClientPipelined {
- runChainSyncClientPipelined :: m (ClientPipelinedStIdle 'Z header point tip m a)
- data ClientPipelinedStIdle (n :: N) header point tip (m :: Type -> Type) a where
- SendMsgRequestNext :: forall header point tip (m :: Type -> Type) a. ClientStNext 'Z header point tip m a -> m (ClientStNext 'Z header point tip m a) -> ClientPipelinedStIdle 'Z header point tip m a
- SendMsgRequestNextPipelined :: forall (n :: N) header point tip (m :: Type -> Type) a. ClientPipelinedStIdle ('S n) header point tip m a -> ClientPipelinedStIdle n header point tip m a
- SendMsgFindIntersect :: forall point header tip (m :: Type -> Type) a. [point] -> ClientPipelinedStIntersect header point tip m a -> ClientPipelinedStIdle 'Z header point tip m a
- CollectResponse :: forall (m :: Type -> Type) (n1 :: N) header point tip a. Maybe (m (ClientPipelinedStIdle ('S n1) header point tip m a)) -> ClientStNext n1 header point tip m a -> ClientPipelinedStIdle ('S n1) header point tip m a
- SendMsgDone :: forall a header point tip (m :: Type -> Type). a -> ClientPipelinedStIdle 'Z header point tip m a
- data ClientStNext (n :: N) header point tip (m :: Type -> Type) a = ClientStNext {
- recvMsgRollForward :: header -> tip -> m (ClientPipelinedStIdle n header point tip m a)
- recvMsgRollBackward :: point -> tip -> m (ClientPipelinedStIdle n header point tip m a)
- data ClientPipelinedStIntersect header point tip (m :: Type -> Type) a = ClientPipelinedStIntersect {
- recvMsgIntersectFound :: point -> tip -> m (ClientPipelinedStIdle 'Z header point tip m a)
- recvMsgIntersectNotFound :: tip -> m (ClientPipelinedStIdle 'Z header point tip m a)
- data ChainSyncInstruction header point tip
- = RollForward !header !tip
- | RollBackward !point !tip
- data PipelineDecision (n :: N) where
- Request :: PipelineDecision 'Z
- Pipeline :: forall (n :: N). PipelineDecision n
- CollectOrPipeline :: forall (n1 :: N). PipelineDecision ('S n1)
- Collect :: forall (n1 :: N). PipelineDecision ('S n1)
- data MkPipelineDecision where
- MkPipelineDecision :: (forall (n :: N). Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> (PipelineDecision n, MkPipelineDecision)) -> MkPipelineDecision
- runPipelineDecision :: forall (n :: N). MkPipelineDecision -> Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> (PipelineDecision n, MkPipelineDecision)
- constantPipelineDecision :: (forall (n :: N). Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> PipelineDecision n) -> MkPipelineDecision
- pipelineDecisionMax :: forall (n :: N). Word32 -> Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> PipelineDecision n
- pipelineDecisionMin :: forall (n :: N). Word32 -> Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> PipelineDecision n
- pipelineDecisionLowHighMark :: Word32 -> Word32 -> MkPipelineDecision
- data N
- data Nat (n :: N) where
- natToInt :: forall (n :: N). Nat n -> Int
- mapChainSyncClientPipelined :: forall header header' point point' tip tip' (m :: Type -> Type) a. Functor m => (point -> point') -> (point' -> point) -> (header' -> header) -> (tip' -> tip) -> ChainSyncClientPipelined header point tip m a -> ChainSyncClientPipelined header' point' tip' m a
Pipelined protocol type for the client
The protocol states from the point of view of the client.
newtype ChainSyncClientPipelined header point tip (m :: Type -> Type) a #
Constructors
ChainSyncClientPipelined | |
Fields
|
data ClientPipelinedStIdle (n :: N) header point tip (m :: Type -> Type) a where #
Constructors
SendMsgRequestNext :: forall header point tip (m :: Type -> Type) a. ClientStNext 'Z header point tip m a -> m (ClientStNext 'Z header point tip m a) -> ClientPipelinedStIdle 'Z header point tip m a | |
SendMsgRequestNextPipelined :: forall (n :: N) header point tip (m :: Type -> Type) a. ClientPipelinedStIdle ('S n) header point tip m a -> ClientPipelinedStIdle n header point tip m a | |
SendMsgFindIntersect :: forall point header tip (m :: Type -> Type) a. [point] -> ClientPipelinedStIntersect header point tip m a -> ClientPipelinedStIdle 'Z header point tip m a | |
CollectResponse :: forall (m :: Type -> Type) (n1 :: N) header point tip a. Maybe (m (ClientPipelinedStIdle ('S n1) header point tip m a)) -> ClientStNext n1 header point tip m a -> ClientPipelinedStIdle ('S n1) header point tip m a | |
SendMsgDone :: forall a header point tip (m :: Type -> Type). a -> ClientPipelinedStIdle 'Z header point tip m a |
data ClientStNext (n :: N) header point tip (m :: Type -> Type) a #
Constructors
ClientStNext | |
Fields
|
data ClientPipelinedStIntersect header point tip (m :: Type -> Type) a #
Constructors
ClientPipelinedStIntersect | |
Fields
|
data ChainSyncInstruction header point tip #
Constructors
RollForward !header !tip | |
RollBackward !point !tip |
Implementation Helpers
It's generally idiomatic to use these functions to implement your pipelined client. It aids in deciding when to make pipelined requests vs process received responses.
data PipelineDecision (n :: N) where #
Constructors
Request :: PipelineDecision 'Z | |
Pipeline :: forall (n :: N). PipelineDecision n | |
CollectOrPipeline :: forall (n1 :: N). PipelineDecision ('S n1) | |
Collect :: forall (n1 :: N). PipelineDecision ('S n1) |
data MkPipelineDecision where #
Constructors
MkPipelineDecision :: (forall (n :: N). Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> (PipelineDecision n, MkPipelineDecision)) -> MkPipelineDecision |
runPipelineDecision :: forall (n :: N). MkPipelineDecision -> Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> (PipelineDecision n, MkPipelineDecision) #
constantPipelineDecision :: (forall (n :: N). Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> PipelineDecision n) -> MkPipelineDecision #
pipelineDecisionMax :: forall (n :: N). Word32 -> Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> PipelineDecision n #
pipelineDecisionMin :: forall (n :: N). Word32 -> Nat n -> WithOrigin BlockNo -> WithOrigin BlockNo -> PipelineDecision n #
Type level natural numbers
Utilities
mapChainSyncClientPipelined :: forall header header' point point' tip tip' (m :: Type -> Type) a. Functor m => (point -> point') -> (point' -> point) -> (header' -> header) -> (tip' -> tip) -> ChainSyncClientPipelined header point tip m a -> ChainSyncClientPipelined header' point' tip' m a #