| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Eff.Concurrent.Protocol.Request
Description
Proxies and containers for casts and calls.
Since: 0.15.0
Synopsis
- data Request protocol where
- Call :: forall protocol reply. (Tangible reply, TangiblePdu protocol (Synchronous reply)) => RequestOrigin protocol reply -> Pdu protocol (Synchronous reply) -> Request protocol
- Cast :: forall protocol. (TangiblePdu protocol Asynchronous, NFData (Pdu protocol Asynchronous)) => Pdu protocol Asynchronous -> Request protocol
- sendReply :: (SetMember Process (Process q) eff, Member Interrupts eff, Tangible reply, Typeable protocol) => Serializer (Reply protocol reply) -> RequestOrigin protocol reply -> reply -> Eff eff ()
- data RequestOrigin (proto :: Type) reply = RequestOrigin {}
- embedRequestOrigin :: EmbedProtocol outer inner => RequestOrigin inner reply -> RequestOrigin outer reply
- toEmbeddedOrigin :: EmbedProtocol outer inner => RequestOrigin outer reply -> RequestOrigin inner reply
- data Reply protocol reply where
- embedReplySerializer :: EmbedProtocol outer inner => Serializer (Reply outer reply) -> Serializer (Reply inner reply)
- makeRequestOrigin :: (Typeable r, NFData r, SetMember Process (Process q0) e, '[Interrupts] <:: e) => Eff e (RequestOrigin p r)
Documentation
data Request protocol where Source #
A wrapper sum type for calls and casts for the Pdus of a protocol
Since: 0.15.0
Constructors
| Call :: forall protocol reply. (Tangible reply, TangiblePdu protocol (Synchronous reply)) => RequestOrigin protocol reply -> Pdu protocol (Synchronous reply) -> Request protocol | |
| Cast :: forall protocol. (TangiblePdu protocol Asynchronous, NFData (Pdu protocol Asynchronous)) => Pdu protocol Asynchronous -> Request protocol |
sendReply :: (SetMember Process (Process q) eff, Member Interrupts eff, Tangible reply, Typeable protocol) => Serializer (Reply protocol reply) -> RequestOrigin protocol reply -> reply -> Eff eff () Source #
The reply will be deeply evaluated to rnf.
To send replies for EmbedProtocol instances use embedReplySerializer
and toEmbeddedOrigin.
Since: 0.15.0
data RequestOrigin (proto :: Type) reply Source #
Constructors
| RequestOrigin | |
Fields | |
Instances
embedRequestOrigin :: EmbedProtocol outer inner => RequestOrigin inner reply -> RequestOrigin outer reply Source #
Turn an embedded RequestOrigin to a RequestOrigin for the bigger request.
This is the inverse of toEmbeddedOrigin.
This function is strict in all parameters.
Since: 0.24.2
toEmbeddedOrigin :: EmbedProtocol outer inner => RequestOrigin outer reply -> RequestOrigin inner reply Source #
Turn an RequestOrigin to an origin for an embedded request (See EmbedProtocol).
This is useful of a server delegates the calls and casts for an embedded protocol
to functions, that require the Serializer and RequestOrigin in order to call
sendReply.
See also embedReplySerializer.
Since: 0.24.3
data Reply protocol reply where Source #
The wrapper around replies to Calls.
Since: 0.15.0
Constructors
| Reply | |
Fields
| |
embedReplySerializer :: EmbedProtocol outer inner => Serializer (Reply outer reply) -> Serializer (Reply inner reply) Source #
Turn a Serializer for a Pdu instance that contains embedded Pdu values
into a Reply Serializer for the embedded Pdu.
This is useful of a server delegates the calls and casts for an embedded protocol
to functions, that require the Serializer and RequestOrigin in order to call
sendReply.
See also toEmbeddedOrigin.
Since: 0.24.2
makeRequestOrigin :: (Typeable r, NFData r, SetMember Process (Process q0) e, '[Interrupts] <:: e) => Eff e (RequestOrigin p r) Source #
Create a new, unique RequestOrigin value for the current process.
Since: 0.24.0