Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 ∷ ∀ 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 ∷ ∀ (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 ∷ ∀ point header tip (m ∷ Type → Type) a. [point] → ClientPipelinedStIntersect header point tip m a → ClientPipelinedStIdle 'Z header point tip m a
- CollectResponse ∷ ∀ (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 ∷ ∀ 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 ∷ ∀ (n ∷ N). PipelineDecision n
- CollectOrPipeline ∷ ∀ (n1 ∷ N). PipelineDecision ('S n1)
- Collect ∷ ∀ (n1 ∷ N). PipelineDecision ('S n1)
- data MkPipelineDecision where
- MkPipelineDecision ∷ (∀ (n ∷ N). Nat n → WithOrigin BlockNo → WithOrigin BlockNo → (PipelineDecision n, MkPipelineDecision)) → MkPipelineDecision
- runPipelineDecision ∷ ∀ (n ∷ N). MkPipelineDecision → Nat n → WithOrigin BlockNo → WithOrigin BlockNo → (PipelineDecision n, MkPipelineDecision)
- constantPipelineDecision ∷ (∀ (n ∷ N). Nat n → WithOrigin BlockNo → WithOrigin BlockNo → PipelineDecision n) → MkPipelineDecision
- pipelineDecisionMax ∷ ∀ (n ∷ N). Word32 → Nat n → WithOrigin BlockNo → WithOrigin BlockNo → PipelineDecision n
- pipelineDecisionMin ∷ ∀ (n ∷ N). Word32 → Nat n → WithOrigin BlockNo → WithOrigin BlockNo → PipelineDecision n
- pipelineDecisionLowHighMark ∷ Word32 → Word32 → MkPipelineDecision
- data N
- data Nat (n ∷ N) where
- natToInt ∷ ∀ (n ∷ N). Nat n → Int
- mapChainSyncClientPipelined ∷ ∀ 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 #
ChainSyncClientPipelined | |
|
data ClientPipelinedStIdle (n ∷ N) header point tip (m ∷ Type → Type) a where #
SendMsgRequestNext ∷ ∀ 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 ∷ ∀ (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 ∷ ∀ point header tip (m ∷ Type → Type) a. [point] → ClientPipelinedStIntersect header point tip m a → ClientPipelinedStIdle 'Z header point tip m a | |
CollectResponse ∷ ∀ (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 ∷ ∀ 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 | |
|
data ClientPipelinedStIntersect header point tip (m ∷ Type → Type) a #
ClientPipelinedStIntersect | |
|
data ChainSyncInstruction header point tip #
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 #
Request ∷ PipelineDecision 'Z | |
Pipeline ∷ ∀ (n ∷ N). PipelineDecision n | |
CollectOrPipeline ∷ ∀ (n1 ∷ N). PipelineDecision ('S n1) | |
Collect ∷ ∀ (n1 ∷ N). PipelineDecision ('S n1) |
data MkPipelineDecision where #
MkPipelineDecision ∷ (∀ (n ∷ N). Nat n → WithOrigin BlockNo → WithOrigin BlockNo → (PipelineDecision n, MkPipelineDecision)) → MkPipelineDecision |
runPipelineDecision ∷ ∀ (n ∷ N). MkPipelineDecision → Nat n → WithOrigin BlockNo → WithOrigin BlockNo → (PipelineDecision n, MkPipelineDecision) #
constantPipelineDecision ∷ (∀ (n ∷ N). Nat n → WithOrigin BlockNo → WithOrigin BlockNo → PipelineDecision n) → MkPipelineDecision #
pipelineDecisionMax ∷ ∀ (n ∷ N). Word32 → Nat n → WithOrigin BlockNo → WithOrigin BlockNo → PipelineDecision n #
pipelineDecisionMin ∷ ∀ (n ∷ N). Word32 → Nat n → WithOrigin BlockNo → WithOrigin BlockNo → PipelineDecision n #
Type level natural numbers
Utilities
mapChainSyncClientPipelined ∷ ∀ 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 #