zeromq-haskell-0.1: bindings to zeromq

Portabilitynon-portable
Stabilityexperimental
Maintainertoralf.wittner@gmail.com

System.ZMQ

Description

 

Synopsis

Documentation

data Context Source

A 0MQ context representation.

A 0MQ Socket.

data Socket a Source

data Flag Source

The events to wait for in poll (cf. man zmq_poll)

Constructors

NoBlock

ZMQ_NOBLOCK

NoFlush

ZMQ_NOFLUSH

Instances

data SocketOption Source

Flags to apply on send operations (cf. man zmq_send)

Constructors

HighWM Int64

ZMQ_HWM

LowWM Int64

ZMQ_LWM

Swap Int64

ZMQ_SWAP

Affinity Int64

ZMQ_AFFINITY

Identity String

ZMQ_IDENTITY

Rate Word64

ZMQ_RATE

RecoveryIVL Word64

ZMQ_RECOVERY_IVL

McastLoop Word64

ZMQ_MCAST_LOOP

SendBuf Word64

ZMQ_SNDBUF

ReceiveBuf Word64

ZMQ_RCVBUF

data Poll Source

Initialize a 0MQ context (cf. zmq_init).

Constructors

forall a . S (Socket a) PollEvent 
F Fd PollEvent 

data PollEvent Source

Type representing a descriptor, poll is waiting for (either a 0MQ socket or a file descriptor) plus the type of event of wait for.

Constructors

In

ZMQ_POLLIN

Out

ZMQ_POLLOUT

InOut

ZMQ_POLLIN | ZMQ_POLLOUT

data P2P Source

Constructors

P2P 

Instances

SType P2P 

data Pub Source

Constructors

Pub 

Instances

SType Pub 

data Sub Source

Constructors

Sub 

Instances

SubsType Sub

The option to set on 0MQ sockets (cf. man zmq_setsockopt)

SType Sub 

data Req Source

Constructors

Req 

Instances

SType Req 

data Rep Source

Constructors

Rep 

Instances

SType Rep 

data XReq Source

Constructors

Xreq 

Instances

SType XReq 

data XRep Source

Constructors

Xrep 

Instances

SType XRep 

data Up Source

Constructors

Up 

Instances

SType Up 

data Down Source

Constructors

Down 

Instances

SType Down 

init :: Size -> Size -> Bool -> IO ContextSource

Terminate 0MQ context (cf. zmq_term).

term :: Context -> IO ()Source

Create a new 0MQ socket within the given context.

socket :: SType a => Context -> a -> IO (Socket a)Source

Close a 0MQ socket.

close :: Socket a -> IO ()Source

Set the given option on the socket. Please note that there are certain combatibility constraints w.r.t the socket type (cf. man zmq_setsockopt).

Please note that subscribe/unsubscribe is handled with separate functions.

setOption :: Socket a -> SocketOption -> IO ()Source

Subscribe Socket to given subscription.

subscribe :: SubsType a => Socket a -> String -> IO ()Source

Unsubscribe Socket from given subscription.

unsubscribe :: SubsType a => Socket a -> String -> IO ()Source

Bind the socket to the given address (zmq_bind)

bind :: Socket a -> String -> IO ()Source

Connect the socket to the given address (zmq_connect).

connect :: Socket a -> String -> IO ()Source

Send the given ByteString over the socket (zmq_send).

send :: Socket a -> ByteString -> [Flag] -> IO ()Source

Flush the given socket (useful for sends with NoFlush).

flush :: Socket a -> IO ()Source

Receive a ByteString from socket (zmq_recv).

receive :: Socket a -> [Flag] -> IO ByteStringSource

Polls for events on the given Poll descriptors. Returns the list of Poll descriptors for which an event occured (cf. zmq_poll).

poll :: [Poll] -> Timeout -> IO [Poll]Source