File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
typed-protocols/src/Network/TypedProtocol Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,14 @@ data Peer ps pr pl st m a where
227227deriving instance Functor m => Functor (Peer ps pr pl st m )
228228
229229
230- -- | Receiver
230+ -- | Receiver. It is limited to only awaiting for messages and running monadic
231+ -- computations. This means that on can only pipeline messages if they can be
232+ -- connected by state transitions which all have remote agency.
233+ --
234+ -- The receiver runs in parallel, see `runPipelinedPeerWithDriver`. This makes
235+ -- pipelining quite effective, since the receiver callbacks are called in
236+ -- a separate thread which can effectively use CPU cache.
237+ --
231238type Receiver :: forall ps
232239 -> PeerRole
233240 -> ps
@@ -241,11 +248,17 @@ type Receiver :: forall ps
241248 -> Type
242249data Receiver ps pr st stdone m c where
243250
251+ -- | Execute a monadic computation.
252+ --
244253 ReceiverEffect :: m (Receiver ps pr st stdone m c )
245254 -> Receiver ps pr st stdone m c
246255
256+ -- | Return value.
257+ --
247258 ReceiverDone :: c -> Receiver ps pr stdone stdone m c
248259
260+ -- | Await for for a remote transition.
261+ --
249262 ReceiverAwait :: ( StateTokenI st
250263 , ActiveState st
251264 )
You can’t perform that action at this time.
0 commit comments