| Portability | non-portable (requires STM) |
|---|---|
| Stability | experimental |
| Maintainer | phil@haphazardhouse.net |
| Safe Haskell | None |
Network.Transport
Description
A Transport abstracts the details of message delivery, and defines the interfaces
that specific Transport implementations should provide in order to deliver messages
for Endpoints.
The definition of a transport is deliberately low-level in nature. Unless a specific transport describes itself as supporting features like guaranteed delivery, applications should NOT assume that message delivery is reliable.
For example, if a sender sends a message to a name that has not yet been bound, then immediately waits on the response for that message, then the application may hang, as the original message may have been dropped.
However, many application may find it easier to push features such as reliable message delivery into a custom transport, leaving the application only having to concern itself with the messages being delivered rather than how they arrive.
- type Address = String
- data Binding = Binding {
- bindingName :: Name
- unbind :: IO ()
- data Envelope = Envelope {}
- type Message = ByteString
- type Name = String
- data Resolver
- resolve :: Resolver -> Name -> IO (Maybe Address)
- resolverFromList :: [(Name, Address)] -> Resolver
- type Scheme = String
- data Transport = Transport {}
- module Control.Concurrent.Mailbox
Documentation
A Mailbox is a place where transports can put messages for Endpoints
to receive. Typically Endpoints will use the same Mailbox when
binding or connecting with a Transport.
An address is a logical identifier suitable for establishing a connection to
another Endpoint over a Transport. It's use (if at all) is specific to the Transport
in question.
Constructors
| Binding | |
Fields
| |
Constructors
| Envelope | |
Fields | |
type Message = ByteStringSource
Messages are containers for arbitrary data that may be sent to other Endpoints.
Name for uniquely identifying an Endpoint; suitable for identifying
the target destination for a Message.
resolverFromList :: [(Name, Address)] -> ResolverSource
A Transport defines a specific method for establishing connections
between Endpoints.
module Control.Concurrent.Mailbox