ouroboros-network:protocols
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Protocol.ObjectDiffusion.Inbound

Description

A view of the object diffusion protocol from the point of view of the inbound/client peer.

This provides a view that uses less complex types and should be easier to use than the underlying typed protocol itself.

For execution, a conversion into the typed protocol is provided.

Synopsis

Protocol type for the inbound

data ObjectDiffusionInboundPipelined objectId object (m :: Type -> Type) a where Source #

Constructors

ObjectDiffusionInboundPipelined :: forall objectId object (m :: Type -> Type) a. InboundStIdle 'Z objectId object m a -> ObjectDiffusionInboundPipelined objectId object m a 

data InboundStIdle (n :: N) objectId object (m :: Type -> Type) a where Source #

Constructors

SendMsgRequestObjectIdsBlocking 

Fields

SendMsgRequestObjectIdsPipelined :: forall (n :: N) objectId object (m :: Type -> Type) a. NumObjectIdsAck -> NumObjectIdsReq -> InboundStIdle ('S n) objectId object m a -> InboundStIdle n objectId object m a 
SendMsgRequestObjectsPipelined :: forall objectId (n :: N) object (m :: Type -> Type) a. [objectId] -> InboundStIdle ('S n) objectId object m a -> InboundStIdle n objectId object m a 
CollectPipelined :: forall (n1 :: N) objectId object (m :: Type -> Type) a. Maybe (InboundStIdle ('S n1) objectId object m a) -> (Collect objectId object -> InboundStIdle n1 objectId object m a) -> InboundStIdle ('S n1) objectId object m a 
SendMsgDone :: forall a objectId object (m :: Type -> Type). a -> InboundStIdle 'Z objectId object m a 
WithEffect :: forall (m :: Type -> Type) (n :: N) objectId object a. m (InboundStIdle n objectId object m a) -> InboundStIdle n objectId object m a 

data Collect objectId object Source #

This is the type of the pipelined results, collected by CollectPipelined. This protocol can pipeline requests for object ids and objects, so we use a sum of either for collecting the responses.

Constructors

CollectObjectIds NumObjectIdsReq [objectId]

The result of SendMsgRequestObjectIdsPipelined. It also carries the number of objectIds originally requested.

CollectObjects [objectId] [object]

The result of SendMsgRequestObjectsPipelined. The actual reply only contains the objects sent, but this pairs them up with the objects requested. This is because the peer can determine that some objects are no longer needed.

Execution as a typed protocol

objectDiffusionInboundPeerPipelined :: forall objectId object (m :: Type -> Type) a. Functor m => ObjectDiffusionInboundPipelined objectId object m a -> PeerPipelined (ObjectDiffusion objectId object) 'AsClient ('StInit :: ObjectDiffusion objectId object) m a Source #