mongoDB-0.9.4: MongoDB driver

Network.Abstract

Description

Generalize a network connection to a sink and source

Synopsis

Documentation

type IOE = ErrorT IOError IOSource

Be explicit about exception that may be raised.

data Server i o Source

A server receives messages of type i and returns messages of type o.

Constructors

Server HostName PortID 

class WriteMessage i whereSource

Serialize message over handle

Methods

writeMessage :: Handle -> i -> IOE ()Source

Instances

WriteMessage Message 

class ReadMessage o whereSource

Deserialize message from handle

Instances

ReadMessage Response 

class Network n whereSource

A network controls connections to other hosts. It may want to overide to log messages or play them back.

Methods

connect :: (WriteMessage i, ReadMessage o) => n -> Server i o -> IOE (Connection i o)Source

Connect to Server returning the send sink and receive source, throw IOError if can't connect.

Instances

Network Internet

Connect to server. Write messages and receive replies. Not thread-safe, must be wrapped in Pipeline or something.

Network ANetwork 

data Connection i o Source

Constructors

Connection 

Fields

send :: i -> IOE ()
 
receive :: IOE o
 
close :: IO ()
 

data ANetwork Source

Constructors

forall n . Network n => ANetwork n 

Instances

data Internet Source

Normal Network instance, i.e. no logging or replay

Constructors

Internet 

Instances

Network Internet

Connect to server. Write messages and receive replies. Not thread-safe, must be wrapped in Pipeline or something.

class MonadIO' m => NetworkIO m whereSource

Instances