| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Consensus.PeerSimulator.ScheduledBlockFetchServer
Synopsis
- data BlockFetch blk
- = StartBatch [blk]
- | NoBlocks
- data BlockFetchServerHandlers (m ∷ Type → Type) state blk = BlockFetchServerHandlers {
- bfshBlockFetch ∷ ChainRange (Point blk) → state → STM m (Maybe (BlockFetch blk), [TraceScheduledBlockFetchServerEvent state blk])
- bfshSendBlocks ∷ [blk] → state → STM m (Maybe (SendBlocks blk), [TraceScheduledBlockFetchServerEvent state blk])
- data ScheduledBlockFetchServer (m ∷ Type → Type) state blk = ScheduledBlockFetchServer {
- sbfsServer ∷ ScheduledServer m state blk
- sbfsTracer ∷ Tracer m (TraceScheduledBlockFetchServerEvent state blk)
- sbfsHandlers ∷ BlockFetchServerHandlers m state blk
- data SendBlocks blk
- runScheduledBlockFetchServer ∷ ∀ (m ∷ Type → Type) blk. IOLike m ⇒ PeerId → STM m () → STM m (Maybe (NodeState blk)) → Tracer m (TraceEvent blk) → BlockFetchServerHandlers m (NodeState blk) blk → BlockFetchServer blk (Point blk) m ()
Documentation
data BlockFetch blk Source #
Return values for the handlerBlockFetch.
Constructors
| StartBatch [blk] | As a response to the client request, we should send the blocks in the given batch. |
| NoBlocks | Negative response to the client's request for blocks. |
Instances
| Show blk ⇒ Show (BlockFetch blk) Source # | |
Defined in Test.Consensus.PeerSimulator.ScheduledBlockFetchServer Methods showsPrec ∷ Int → BlockFetch blk → ShowS # show ∷ BlockFetch blk → String # showList ∷ [BlockFetch blk] → ShowS # | |
| Eq blk ⇒ Eq (BlockFetch blk) Source # | |
Defined in Test.Consensus.PeerSimulator.ScheduledBlockFetchServer Methods (==) ∷ BlockFetch blk → BlockFetch blk → Bool # (/=) ∷ BlockFetch blk → BlockFetch blk → Bool # | |
data BlockFetchServerHandlers (m ∷ Type → Type) state blk Source #
Handlers for the scheduled BlockFetch server.
Constructors
| BlockFetchServerHandlers | |
Fields
| |
data ScheduledBlockFetchServer (m ∷ Type → Type) state blk Source #
Resources used by a scheduled BlockFetch server. This comprises a generic
ScheduledServer and BlockFetch-specific handlers.
Constructors
| ScheduledBlockFetchServer | |
Fields
| |
data SendBlocks blk Source #
Return values for the handlerSendBlocks.
runScheduledBlockFetchServer ∷ ∀ (m ∷ Type → Type) blk. IOLike m ⇒ PeerId → STM m () → STM m (Maybe (NodeState blk)) → Tracer m (TraceEvent blk) → BlockFetchServerHandlers m (NodeState blk) blk → BlockFetchServer blk (Point blk) m () Source #
Construct a BlockFetch server for the peer simulator.
See scheduledBlockFetchServer.