cardano-api-8.36.1.1: The cardano api
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.ChainSync.ClientPipelined

Synopsis

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

data N #

Constructors

Z 
S N 

data Nat (n :: N) where #

Bundled Patterns

pattern Zero :: () => 'Z ~ n => Nat n 
pattern Succ :: forall m n. () => m ~ 'S n => Nat n -> Nat m 

Instances

Instances details
Show (Nat n) 
Instance details

Defined in Network.TypedProtocol.Pipelined

Methods

showsPrec :: Int -> Nat n -> ShowS Source #

show :: Nat n -> String Source #

showList :: [Nat n] -> ShowS Source #

natToInt :: forall (n :: N). Nat n -> Int #

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 #