zeromq4-haskell-0.8.0: Bindings to ZeroMQ 4.x
Copyright(c) 2010-2013 Toralf Wittner
LicenseMIT
MaintainerToralf Wittner <tw@dtex.org>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

System.ZMQ4

Description

0MQ haskell binding. The API closely follows the C-API of 0MQ with the main difference being that sockets are typed.

Notes

Many option settings use a Restriction to further constrain the range of possible values of their integral types. For example the maximum message size can be given as -1, which means no limit or by greater values, which denote the message size in bytes. The type of setMaxMessageSize is therefore:

setMaxMessageSize :: Integral i
                    => Restricted (Nneg1, Int64) i
                    -> Socket a
                    -> IO ()

which means any integral value in the range of -1 to (maxBound :: Int64) can be given. To create a restricted value from plain value, use toRestricted or restrict.

Synopsis

Type Definitions

Socket Types

data Pair Source #

Constructors

Pair 

Instances

Instances details
Generic Pair Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Pair 
Instance details

Defined in System.ZMQ4

type Rep Pair = D1 ('MetaData "Pair" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Pair" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Pair -> Rep Pair x #

to :: Rep Pair x -> Pair #

Eq Pair Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Pair -> Pair -> Bool #

(/=) :: Pair -> Pair -> Bool #

Receiver Pair Source # 
Instance details

Defined in System.ZMQ4

Sender Pair Source # 
Instance details

Defined in System.ZMQ4

SocketType Pair Source # 
Instance details

Defined in System.ZMQ4

type Rep Pair Source # 
Instance details

Defined in System.ZMQ4

type Rep Pair = D1 ('MetaData "Pair" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Pair" 'PrefixI 'False) (U1 :: Type -> Type))

data Pub Source #

Constructors

Pub 

Instances

Instances details
Generic Pub Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Pub 
Instance details

Defined in System.ZMQ4

type Rep Pub = D1 ('MetaData "Pub" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Pub" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Pub -> Rep Pub x #

to :: Rep Pub x -> Pub #

Eq Pub Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Pub -> Pub -> Bool #

(/=) :: Pub -> Pub -> Bool #

Conflatable Pub Source # 
Instance details

Defined in System.ZMQ4

Sender Pub Source # 
Instance details

Defined in System.ZMQ4

SocketType Pub Source # 
Instance details

Defined in System.ZMQ4

type Rep Pub Source # 
Instance details

Defined in System.ZMQ4

type Rep Pub = D1 ('MetaData "Pub" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Pub" 'PrefixI 'False) (U1 :: Type -> Type))

data Sub Source #

Constructors

Sub 

Instances

Instances details
Generic Sub Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Sub 
Instance details

Defined in System.ZMQ4

type Rep Sub = D1 ('MetaData "Sub" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Sub" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Sub -> Rep Sub x #

to :: Rep Sub x -> Sub #

Eq Sub Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Sub -> Sub -> Bool #

(/=) :: Sub -> Sub -> Bool #

Conflatable Sub Source # 
Instance details

Defined in System.ZMQ4

Receiver Sub Source # 
Instance details

Defined in System.ZMQ4

Subscriber Sub Source # 
Instance details

Defined in System.ZMQ4

SocketType Sub Source # 
Instance details

Defined in System.ZMQ4

type Rep Sub Source # 
Instance details

Defined in System.ZMQ4

type Rep Sub = D1 ('MetaData "Sub" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Sub" 'PrefixI 'False) (U1 :: Type -> Type))

data XPub Source #

Constructors

XPub 

Instances

Instances details
Generic XPub Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep XPub 
Instance details

Defined in System.ZMQ4

type Rep XPub = D1 ('MetaData "XPub" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "XPub" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: XPub -> Rep XPub x #

to :: Rep XPub x -> XPub #

Eq XPub Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: XPub -> XPub -> Bool #

(/=) :: XPub -> XPub -> Bool #

Receiver XPub Source # 
Instance details

Defined in System.ZMQ4

Sender XPub Source # 
Instance details

Defined in System.ZMQ4

SocketType XPub Source # 
Instance details

Defined in System.ZMQ4

type Rep XPub Source # 
Instance details

Defined in System.ZMQ4

type Rep XPub = D1 ('MetaData "XPub" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "XPub" 'PrefixI 'False) (U1 :: Type -> Type))

data XSub Source #

Constructors

XSub 

Instances

Instances details
Generic XSub Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep XSub 
Instance details

Defined in System.ZMQ4

type Rep XSub = D1 ('MetaData "XSub" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "XSub" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: XSub -> Rep XSub x #

to :: Rep XSub x -> XSub #

Eq XSub Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: XSub -> XSub -> Bool #

(/=) :: XSub -> XSub -> Bool #

Receiver XSub Source # 
Instance details

Defined in System.ZMQ4

Sender XSub Source # 
Instance details

Defined in System.ZMQ4

SocketType XSub Source # 
Instance details

Defined in System.ZMQ4

type Rep XSub Source # 
Instance details

Defined in System.ZMQ4

type Rep XSub = D1 ('MetaData "XSub" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "XSub" 'PrefixI 'False) (U1 :: Type -> Type))

data Req Source #

Constructors

Req 

Instances

Instances details
Generic Req Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Req 
Instance details

Defined in System.ZMQ4

type Rep Req = D1 ('MetaData "Req" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Req" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Req -> Rep Req x #

to :: Rep Req x -> Req #

Eq Req Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Req -> Req -> Bool #

(/=) :: Req -> Req -> Bool #

Receiver Req Source # 
Instance details

Defined in System.ZMQ4

SendProbe Req Source # 
Instance details

Defined in System.ZMQ4

Sender Req Source # 
Instance details

Defined in System.ZMQ4

SocketType Req Source # 
Instance details

Defined in System.ZMQ4

type Rep Req Source # 
Instance details

Defined in System.ZMQ4

type Rep Req = D1 ('MetaData "Req" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Req" 'PrefixI 'False) (U1 :: Type -> Type))

data Rep Source #

Constructors

Rep 

Instances

Instances details
Generic Rep Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Rep 
Instance details

Defined in System.ZMQ4

type Rep Rep = D1 ('MetaData "Rep" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Rep" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Rep -> Rep Rep x #

to :: Rep Rep x -> Rep #

Eq Rep Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Rep -> Rep -> Bool #

(/=) :: Rep -> Rep -> Bool #

Receiver Rep Source # 
Instance details

Defined in System.ZMQ4

Sender Rep Source # 
Instance details

Defined in System.ZMQ4

SocketType Rep Source # 
Instance details

Defined in System.ZMQ4

type Rep Rep Source # 
Instance details

Defined in System.ZMQ4

type Rep Rep = D1 ('MetaData "Rep" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Rep" 'PrefixI 'False) (U1 :: Type -> Type))

data Dealer Source #

Constructors

Dealer 

Instances

Instances details
Generic Dealer Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Dealer 
Instance details

Defined in System.ZMQ4

type Rep Dealer = D1 ('MetaData "Dealer" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Dealer" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Dealer -> Rep Dealer x #

to :: Rep Dealer x -> Dealer #

Eq Dealer Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Dealer -> Dealer -> Bool #

(/=) :: Dealer -> Dealer -> Bool #

Conflatable Dealer Source # 
Instance details

Defined in System.ZMQ4

Receiver Dealer Source # 
Instance details

Defined in System.ZMQ4

SendProbe Dealer Source # 
Instance details

Defined in System.ZMQ4

Sender Dealer Source # 
Instance details

Defined in System.ZMQ4

SocketType Dealer Source # 
Instance details

Defined in System.ZMQ4

type Rep Dealer Source # 
Instance details

Defined in System.ZMQ4

type Rep Dealer = D1 ('MetaData "Dealer" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Dealer" 'PrefixI 'False) (U1 :: Type -> Type))

data Router Source #

Constructors

Router 

Instances

Instances details
Generic Router Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Router 
Instance details

Defined in System.ZMQ4

type Rep Router = D1 ('MetaData "Router" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Router" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Router -> Rep Router x #

to :: Rep Router x -> Router #

Eq Router Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Router -> Router -> Bool #

(/=) :: Router -> Router -> Bool #

Receiver Router Source # 
Instance details

Defined in System.ZMQ4

SendProbe Router Source # 
Instance details

Defined in System.ZMQ4

Sender Router Source # 
Instance details

Defined in System.ZMQ4

SocketType Router Source # 
Instance details

Defined in System.ZMQ4

type Rep Router Source # 
Instance details

Defined in System.ZMQ4

type Rep Router = D1 ('MetaData "Router" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Router" 'PrefixI 'False) (U1 :: Type -> Type))

type XReq = Dealer Source #

Deprecated: Use Dealer

type XRep = Router Source #

Deprecated: Use Router

data Pull Source #

Constructors

Pull 

Instances

Instances details
Generic Pull Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Pull 
Instance details

Defined in System.ZMQ4

type Rep Pull = D1 ('MetaData "Pull" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Pull" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Pull -> Rep Pull x #

to :: Rep Pull x -> Pull #

Eq Pull Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Pull -> Pull -> Bool #

(/=) :: Pull -> Pull -> Bool #

Conflatable Pull Source # 
Instance details

Defined in System.ZMQ4

Receiver Pull Source # 
Instance details

Defined in System.ZMQ4

SocketType Pull Source # 
Instance details

Defined in System.ZMQ4

type Rep Pull Source # 
Instance details

Defined in System.ZMQ4

type Rep Pull = D1 ('MetaData "Pull" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Pull" 'PrefixI 'False) (U1 :: Type -> Type))

data Push Source #

Constructors

Push 

Instances

Instances details
Generic Push Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Push 
Instance details

Defined in System.ZMQ4

type Rep Push = D1 ('MetaData "Push" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Push" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Push -> Rep Push x #

to :: Rep Push x -> Push #

Eq Push Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Push -> Push -> Bool #

(/=) :: Push -> Push -> Bool #

Conflatable Push Source # 
Instance details

Defined in System.ZMQ4

Sender Push Source # 
Instance details

Defined in System.ZMQ4

SocketType Push Source # 
Instance details

Defined in System.ZMQ4

type Rep Push Source # 
Instance details

Defined in System.ZMQ4

type Rep Push = D1 ('MetaData "Push" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Push" 'PrefixI 'False) (U1 :: Type -> Type))

data Stream Source #

Constructors

Stream 

Instances

Instances details
Generic Stream Source # 
Instance details

Defined in System.ZMQ4

Associated Types

type Rep Stream 
Instance details

Defined in System.ZMQ4

type Rep Stream = D1 ('MetaData "Stream" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Stream" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Stream -> Rep Stream x #

to :: Rep Stream x -> Stream #

Eq Stream Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Stream -> Stream -> Bool #

(/=) :: Stream -> Stream -> Bool #

Receiver Stream Source # 
Instance details

Defined in System.ZMQ4

Sender Stream Source # 
Instance details

Defined in System.ZMQ4

SocketType Stream Source # 
Instance details

Defined in System.ZMQ4

type Rep Stream Source # 
Instance details

Defined in System.ZMQ4

type Rep Stream = D1 ('MetaData "Stream" "System.ZMQ4" "zeromq4-haskell-0.8.0-4TWlySx52LoB8tuO7aoRa1" 'False) (C1 ('MetaCons "Stream" 'PrefixI 'False) (U1 :: Type -> Type))

Socket type-classes

class SocketType a Source #

Socket types.

Minimal complete definition

zmqSocketType

Instances

Instances details
SocketType Dealer Source # 
Instance details

Defined in System.ZMQ4

SocketType Pair Source # 
Instance details

Defined in System.ZMQ4

SocketType Pub Source # 
Instance details

Defined in System.ZMQ4

SocketType Pull Source # 
Instance details

Defined in System.ZMQ4

SocketType Push Source # 
Instance details

Defined in System.ZMQ4

SocketType Rep Source # 
Instance details

Defined in System.ZMQ4

SocketType Req Source # 
Instance details

Defined in System.ZMQ4

SocketType Router Source # 
Instance details

Defined in System.ZMQ4

SocketType Stream Source # 
Instance details

Defined in System.ZMQ4

SocketType Sub Source # 
Instance details

Defined in System.ZMQ4

SocketType XPub Source # 
Instance details

Defined in System.ZMQ4

SocketType XSub Source # 
Instance details

Defined in System.ZMQ4

class Sender a Source #

Sockets which can send.

Instances

Instances details
Sender Dealer Source # 
Instance details

Defined in System.ZMQ4

Sender Pair Source # 
Instance details

Defined in System.ZMQ4

Sender Pub Source # 
Instance details

Defined in System.ZMQ4

Sender Push Source # 
Instance details

Defined in System.ZMQ4

Sender Rep Source # 
Instance details

Defined in System.ZMQ4

Sender Req Source # 
Instance details

Defined in System.ZMQ4

Sender Router Source # 
Instance details

Defined in System.ZMQ4

Sender Stream Source # 
Instance details

Defined in System.ZMQ4

Sender XPub Source # 
Instance details

Defined in System.ZMQ4

Sender XSub Source # 
Instance details

Defined in System.ZMQ4

class Receiver a Source #

Sockets which can receive.

Instances

Instances details
Receiver Dealer Source # 
Instance details

Defined in System.ZMQ4

Receiver Pair Source # 
Instance details

Defined in System.ZMQ4

Receiver Pull Source # 
Instance details

Defined in System.ZMQ4

Receiver Rep Source # 
Instance details

Defined in System.ZMQ4

Receiver Req Source # 
Instance details

Defined in System.ZMQ4

Receiver Router Source # 
Instance details

Defined in System.ZMQ4

Receiver Stream Source # 
Instance details

Defined in System.ZMQ4

Receiver Sub Source # 
Instance details

Defined in System.ZMQ4

Receiver XPub Source # 
Instance details

Defined in System.ZMQ4

Receiver XSub Source # 
Instance details

Defined in System.ZMQ4

class Subscriber a Source #

Sockets which can subscribe.

Instances

Instances details
Subscriber Sub Source # 
Instance details

Defined in System.ZMQ4

class SocketLike (s :: Type -> Type) Source #

Minimal complete definition

toSocket

Instances

Instances details
SocketLike Socket Source # 
Instance details

Defined in System.ZMQ4.Internal

Methods

toSocket :: Socket t -> Socket t Source #

SocketLike (Socket z) Source # 
Instance details

Defined in System.ZMQ4.Monadic

Methods

toSocket :: Socket z t -> Socket t Source #

class Conflatable a Source #

Sockets which can be conflated.

Instances

Instances details
Conflatable Dealer Source # 
Instance details

Defined in System.ZMQ4

Conflatable Pub Source # 
Instance details

Defined in System.ZMQ4

Conflatable Pull Source # 
Instance details

Defined in System.ZMQ4

Conflatable Push Source # 
Instance details

Defined in System.ZMQ4

Conflatable Sub Source # 
Instance details

Defined in System.ZMQ4

class SendProbe a Source #

Sockets which can send probes (cf. setProbeRouter).

Instances

Instances details
SendProbe Dealer Source # 
Instance details

Defined in System.ZMQ4

SendProbe Req Source # 
Instance details

Defined in System.ZMQ4

SendProbe Router Source # 
Instance details

Defined in System.ZMQ4

Various type definitions

type Size = Word Source #

data Context Source #

A 0MQ context representation.

data Socket a Source #

A 0MQ Socket.

Instances

Instances details
SocketLike Socket Source # 
Instance details

Defined in System.ZMQ4.Internal

Methods

toSocket :: Socket t -> Socket t Source #

data Flag Source #

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

Constructors

DontWait

ZMQ_DONTWAIT (Only relevant on Windows.)

SendMore

ZMQ_SNDMORE

Instances

Instances details
Show Flag Source # 
Instance details

Defined in System.ZMQ4.Internal

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

Eq Flag Source # 
Instance details

Defined in System.ZMQ4.Internal

Methods

(==) :: Flag -> Flag -> Bool #

(/=) :: Flag -> Flag -> Bool #

Ord Flag Source # 
Instance details

Defined in System.ZMQ4.Internal

Methods

compare :: Flag -> Flag -> Ordering #

(<) :: Flag -> Flag -> Bool #

(<=) :: Flag -> Flag -> Bool #

(>) :: Flag -> Flag -> Bool #

(>=) :: Flag -> Flag -> Bool #

max :: Flag -> Flag -> Flag #

min :: Flag -> Flag -> Flag #

data Switch Source #

Configuration switch

Constructors

Default

Use default setting

On

Activate setting

Off

De-activate setting

Instances

Instances details
Show Switch Source # 
Instance details

Defined in System.ZMQ4.Internal

Eq Switch Source # 
Instance details

Defined in System.ZMQ4.Internal

Methods

(==) :: Switch -> Switch -> Bool #

(/=) :: Switch -> Switch -> Bool #

Ord Switch Source # 
Instance details

Defined in System.ZMQ4.Internal

data Event Source #

Socket events.

Constructors

In

ZMQ_POLLIN (incoming messages)

Out

ZMQ_POLLOUT (outgoing messages, i.e. at least 1 byte can be written)

Err
ZMQ_POLLERR

Instances

Instances details
Read Event Source # 
Instance details

Defined in System.ZMQ4

Show Event Source # 
Instance details

Defined in System.ZMQ4

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

Eq Event Source # 
Instance details

Defined in System.ZMQ4

Methods

(==) :: Event -> Event -> Bool #

(/=) :: Event -> Event -> Bool #

Ord Event Source # 
Instance details

Defined in System.ZMQ4

Methods

compare :: Event -> Event -> Ordering #

(<) :: Event -> Event -> Bool #

(<=) :: Event -> Event -> Bool #

(>) :: Event -> Event -> Bool #

(>=) :: Event -> Event -> Bool #

max :: Event -> Event -> Event #

min :: Event -> Event -> Event #

data Poll (s :: Type -> Type) (m :: Type -> Type) where Source #

A Poll value contains the object to poll (a 0MQ socket or a file descriptor), the set of Events which are of interest and--optionally-- a callback-function which is invoked iff the set of interested events overlaps with the actual events.

Constructors

Sock :: forall (s :: Type -> Type) t (m :: Type -> Type). s t -> [Event] -> Maybe ([Event] -> m ()) -> Poll s m 
File :: forall (m :: Type -> Type) (s :: Type -> Type). Fd -> [Event] -> Maybe ([Event] -> m ()) -> Poll s m 

data KeyFormat a where Source #

Instances

Instances details
Show (KeyFormat a) Source # 
Instance details

Defined in System.ZMQ4.Internal

Eq (KeyFormat a) Source # 
Instance details

Defined in System.ZMQ4.Internal

Methods

(==) :: KeyFormat a -> KeyFormat a -> Bool #

(/=) :: KeyFormat a -> KeyFormat a -> Bool #

General Operations

withContext :: (Context -> IO a) -> IO a Source #

Run an action with a 0MQ context. The Context supplied to your action will not be valid after the action either returns or throws an exception.

withSocket :: SocketType a => Context -> a -> (Socket a -> IO b) -> IO b Source #

Run an action with a 0MQ socket. The socket will be closed after running the supplied action even if an error occurs. The socket supplied to your action will not be valid after the action terminates.

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

Bind the socket to the given address (cf. zmq_bind).

unbind :: Socket a -> String -> IO () Source #

Unbind the socket from the given address (cf. zmq_unbind).

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

Connect the socket to the given address (cf. zmq_connect).

disconnect :: Socket a -> String -> IO () Source #

Disconnect the socket from the given endpoint (cf. zmq_disconnect).

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

Send the given ByteString over the socket (cf. zmq_sendmsg).

Note: This function always calls zmq_sendmsg in a non-blocking way, i.e. there is no need to provide the ZMQ_DONTWAIT flag as this is used by default. Still send is blocking the thread as long as the message can not be queued on the socket using GHC's threadWaitWrite.

send' :: Sender a => Socket a -> [Flag] -> ByteString -> IO () Source #

Send the given ByteString over the socket (cf. zmq_sendmsg).

This is operationally identical to send socket (Strict.concat (Lazy.toChunks lbs)) flags but may be more efficient.

Note: This function always calls zmq_sendmsg in a non-blocking way, i.e. there is no need to provide the ZMQ_DONTWAIT flag as this is used by default. Still send' is blocking the thread as long as the message can not be queued on the socket using GHC's threadWaitWrite.

sendMulti :: Sender a => Socket a -> NonEmpty ByteString -> IO () Source #

Send a multi-part message. This function applies the SendMore Flag between all message parts. 0MQ guarantees atomic delivery of a multi-part message (cf. zmq_sendmsg).

receive :: Receiver a => Socket a -> IO ByteString Source #

Receive a ByteString from socket (cf. zmq_recvmsg).

Note: This function always calls zmq_recvmsg in a non-blocking way, i.e. there is no need to provide the ZMQ_DONTWAIT flag as this is used by default. Still receive is blocking the thread as long as no data is available using GHC's threadWaitRead.

receiveMulti :: Receiver a => Socket a -> IO [ByteString] Source #

Receive a multi-part message. This function collects all message parts send via sendMulti.

version :: IO (Int, Int, Int) Source #

Return the runtime version of the underlying 0MQ library as a (major, minor, patch) triple.

monitor :: [EventType] -> Context -> Socket a -> IO (Bool -> IO (Maybe EventMsg)) Source #

Monitor socket events (cf. zmq_socket_monitor).

This function returns a function which can be invoked to retrieve the next socket event, potentially blocking until the next one becomes available. When applied to False, monitoring will terminate, i.e. internal monitoring resources will be disposed. Consequently after monitor has been invoked, the returned function must be applied once to False.

socketMonitor :: [EventType] -> String -> Socket a -> IO () Source #

Setup socket monitoring, i.e. a Pair socket which sends monitoring events about the given Socket to the given address.

poll :: forall (s :: Type -> Type) m. (SocketLike s, MonadIO m) => Timeout -> [Poll s m] -> m [[Event]] Source #

Polls for events on the given Poll descriptors. Returns a list of events per descriptor which have occured. (cf. zmq_poll)

subscribe :: Subscriber a => Socket a -> ByteString -> IO () Source #

Subscribe Socket to given subscription.

unsubscribe :: Subscriber a => Socket a -> ByteString -> IO () Source #

Unsubscribe Socket from given subscription.

Context Options (Read)

Context Options (Write)

Socket Options (Read)

conflate :: Conflatable a => Socket a -> IO Bool Source #

Restricts the outgoing and incoming socket buffers to a single message.

delayAttachOnConnect :: Socket a -> IO Bool Source #

Deprecated: Use immediate

ipv4Only :: Socket a -> IO Bool Source #

Deprecated: Use ipv6

Socket Options (Write)

setConflate :: Conflatable a => Bool -> Socket a -> IO () Source #

Restrict the outgoing and incoming socket buffers to a single message.

setDelayAttachOnConnect :: Bool -> Socket a -> IO () Source #

Deprecated: Use setImmediate

setIpv4Only :: Bool -> Socket a -> IO () Source #

Deprecated: Use setIpv6

Restrictions

restrict :: Restriction r v => v -> Restricted r v Source #

Create a restricted value. If the given value does not satisfy the restrictions, a modified variant is used instead, e.g. if an integer is larger than the upper bound, the upper bound value is used.

toRestricted :: Restriction r v => v -> Maybe (Restricted r v) Source #

Create a restricted value. Returns Nothing if the given value does not satisfy all restrictions.

Error Handling

data ZMQError Source #

ZMQError encapsulates information about errors, which occur when using the native 0MQ API, such as error number and message.

errno :: ZMQError -> Int Source #

Error number value.

source :: ZMQError -> String Source #

Source where this error originates from.

message :: ZMQError -> String Source #

Actual error message.

Low-level Functions

init :: Size -> IO Context Source #

Deprecated: Use context

term :: Context -> IO () Source #

Terminate a 0MQ context. Equivalent to zmq_ctx_term.

shutdown :: Context -> IO () Source #

Shutdown a 0MQ context. Equivalent to zmq_ctx_shutdown.

context :: IO Context Source #

Initialize a 0MQ context. Equivalent to zmq_ctx_new.

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

Create a new 0MQ socket within the given context. withSocket provides automatic socket closing and may be safer to use.

close :: Socket a -> IO () Source #

Close a 0MQ socket. withSocket provides automatic socket closing and may be safer to use.

waitRead :: Socket a -> IO () Source #

Wait until data is available for reading from the given Socket. After this function returns, a call to receive will essentially be non-blocking.

waitWrite :: Socket a -> IO () Source #

Wait until data can be written to the given Socket. After this function returns, a call to send will essentially be non-blocking.

Utils

proxy :: Socket a -> Socket b -> Maybe (Socket c) -> IO () Source #

Starts built-in 0MQ proxy (cf. zmq_proxy)

Proxy connects front to back socket

Before calling proxy all sockets should be bound

If the capture socket is not Nothing, the proxy shall send all messages, received on both frontend and backend, to the capture socket.