courier-0.1.0.10: A message-passing library for simplifying network applications

Portabilitynon-portable (requires STM)
Stabilityexperimental
Maintainerphil@haphazardhouse.net
Safe HaskellNone

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.

Synopsis

Documentation

type Address = StringSource

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.

data Binding Source

Bindings are a site for receiving messages on a particular Address through a Transport.

Constructors

Binding 

Fields

bindingName :: Name
 
unbind :: IO ()
 

data Envelope Source

An Envelope is a container for a Message with the Address of the Message's destination.

type Message = ByteStringSource

Messages are containers for arbitrary data that may be sent to other Endpoints.

type Name = StringSource

Name for uniquely identifying an Endpoint; suitable for identifying the target destination for a Message.

data Resolver Source

A Resolver translates a name into an Address, if possible. Transports may find resolvers useful for determing where to reach a specific Endpoint, given it''s Name.

resolve :: Resolver -> Name -> IO (Maybe Address)Source

Ask the Resolver to find one or more Addresses for the provided Name, if any are available from this resolver.

resolverFromList :: [(Name, Address)] -> ResolverSource

A simple Resolver that accepts an association list of Names to Addresses and returns the addresses associated with a given name in the list.

type Scheme = StringSource

A scheme is an identifier for a discrete type of transport.

data Transport Source

A Transport defines a specific method for establishing connections between Endpoints.

Constructors

Transport 

Fields

scheme :: String
 
handles :: Name -> IO Bool
 
bind :: Mailbox Message -> Name -> IO (Either String Binding)
 
sendTo :: Name -> Message -> IO ()
 
shutdown :: IO ()