bcc-api-1.99.0
Safe HaskellNone
LanguageHaskell2010

Bcc.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 ∷ TypeType) a #

Constructors

ChainSyncClientPipelined 

Fields

data ClientPipelinedStIdle (n ∷ N) header point tip (m ∷ TypeType) a where #

Constructors

SendMsgRequestNext ∷ ∀ header point tip (m ∷ TypeType) a. ClientStNext 'Z header point tip m a → m (ClientStNext 'Z header point tip m a) → ClientPipelinedStIdle 'Z header point tip m a 
SendMsgRequestNextPipelined ∷ ∀ (n ∷ N) header point tip (m ∷ TypeType) a. ClientPipelinedStIdle ('S n) header point tip m a → ClientPipelinedStIdle n header point tip m a 
SendMsgFindIntersect ∷ ∀ point header tip (m ∷ TypeType) a. [point] → ClientPipelinedStIntersect header point tip m a → ClientPipelinedStIdle 'Z header point tip m a 
CollectResponse ∷ ∀ (m ∷ TypeType) (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 ∷ ∀ a header point tip (m ∷ TypeType). a → ClientPipelinedStIdle 'Z header point tip m a 

data ClientStNext (n ∷ N) header point tip (m ∷ TypeType) a #

Constructors

ClientStNext 

Fields

data ClientPipelinedStIntersect header point tip (m ∷ TypeType) 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

RequestPipelineDecision 'Z 
Pipeline ∷ ∀ (n ∷ N). PipelineDecision n 
CollectOrPipeline ∷ ∀ (n1 ∷ N). PipelineDecision ('S n1) 
Collect ∷ ∀ (n1 ∷ N). PipelineDecision ('S n1) 

data MkPipelineDecision where #

Constructors

MkPipelineDecision ∷ (∀ (n ∷ N). Nat n → WithOrigin BlockNo → WithOrigin BlockNo → (PipelineDecision n, MkPipelineDecision)) → MkPipelineDecision 

runPipelineDecision ∷ ∀ (n ∷ N). MkPipelineDecisionNat n → WithOrigin BlockNo → WithOrigin BlockNo → (PipelineDecision n, MkPipelineDecision) #

constantPipelineDecision ∷ (∀ (n ∷ N). Nat n → WithOrigin BlockNo → WithOrigin BlockNoPipelineDecision n) → MkPipelineDecision #

pipelineDecisionMax ∷ ∀ (n ∷ N). Word32Nat n → WithOrigin BlockNo → WithOrigin BlockNoPipelineDecision n #

pipelineDecisionMin ∷ ∀ (n ∷ N). Word32Nat n → WithOrigin BlockNo → WithOrigin BlockNoPipelineDecision n #

Type level natural numbers

data N #

Constructors

Z 
S N 

data Nat (n ∷ N) where #

Bundled Patterns

pattern Succ ∷ ∀ m n. () ⇒ m ~ 'S n ⇒ Nat n → Nat m 
pattern Zero ∷ () ⇒ 'Z ~ n ⇒ Nat n 

Instances

Instances details
Show (Nat n) 
Instance details

Defined in Network.TypedProtocol.Pipelined

Methods

showsPrecIntNat n → ShowS Source #

showNat n → String Source #

showList ∷ [Nat n] → ShowS Source #

natToInt ∷ ∀ (n ∷ N). Nat n → Int #

Utilities

mapChainSyncClientPipelined ∷ ∀ header header' point point' tip tip' (m ∷ TypeType) a. Functor m ⇒ (point → point') → (point' → point) → (header' → header) → (tip' → tip) → ChainSyncClientPipelined header point tip m a → ChainSyncClientPipelined header' point' tip' m a #