Skip to content
Browse files

Update to 0MQ 2.0.8

  • Loading branch information...
1 parent af4899d commit 9f007a8a49cacbb214adb4ec2fdafd501720d178 Toralf Wittner committed
Showing with 40 additions and 7 deletions.
  1. +5 −0 AUTHORS
  2. +1 −1 LICENSE
  3. +5 −5 README
  4. +26 −0 src/System/ZMQ.hs
  5. +2 −0 src/System/ZMQ/Base.hsc
  6. +1 −1 zeromq-haskell.cabal
View
5 AUTHORS
@@ -0,0 +1,5 @@
+Toralf Wittner original implementation
+David Himmelstrup added send'
+Nicolas Trangez added support for zmq_device and "queue" test app
+Ville Tirronen added support for ZMG_SNDMORE
+
View
2 LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2010 Toralf Wittner, David Himmelstrup
+Copyright (c) 2010 zeromq-haskell authors
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
View
10 README
@@ -3,11 +3,11 @@ This library provides Haskell bindings to zeromq (http://zeromq.org).
· Current status
-Version 0.3.x - This software currently has *alpha* status, i.e. it had
-only seen very limited testing and changes to its API might happen.
+Version 0.4 - This software currently has *beta* status, i.e. it had
+seen limited testing. Changes to its API may still happen.
-This software was developed and tested on Linux 2.6.32 with GHC-6.12.3
-using the current git HEAD of zeromq2 (http://github.com/sustrik/zeromq2).
+This software was developed and tested on Linux 2.6.35 with GHC-6.12.3
+using zeromq-2.0.8.
· Installation
@@ -36,7 +36,7 @@ The API mostly follows 0MQ's. Public functions are:
One difference to 0MQ's API is that sockets are parameterized types, i.e. there
is not one socket type but when creating a socket the desired socket type has
-to be specified, e.g. 'P2P' and the resulting socket is of type 'Socket P2P'.
+to be specified, e.g. 'Pair' and the resulting socket is of type 'Socket Pair'.
This additional type information is used to ensure that only options applicable
to the socket type can be set, hence ZMQ_SUBSCRIBE and ZMQ_UNSUBSCRIBE which
only apply to ZMQ_SUB sockets have their own functions ('subscribe' and
View
26 src/System/ZMQ.hs
@@ -32,6 +32,8 @@ module System.ZMQ (
Rep(..),
XReq(..),
XRep(..),
+ Pull(..),
+ Push(..),
Up(..),
Down(..),
@@ -147,6 +149,29 @@ data XRep = Xrep
instance SType XRep where
zmqSocketType = const xresponse
+-- | A socket of type ZMQ_PULL is used by a pipeline node to receive
+-- messages from upstream pipeline nodes. Messages are fair-queued from
+-- among all connected upstream nodes. The zmq_send() function is not
+-- implemented for this socket type.
+data Pull = Pull
+instance SType Pull where
+ zmqSocketType = const pull
+
+-- | A socket of type ZMQ_PUSH is used by a pipeline node to send messages
+-- to downstream pipeline nodes. Messages are load-balanced to all connected
+-- downstream nodes. The zmq_recv() function is not implemented for this
+-- socket type.
+--
+-- When a ZMQ_PUSH socket enters an exceptional state due to having reached
+-- the high water mark for all downstream nodes, or if there are no
+-- downstream nodes at all, then any zmq_send(3) operations on the socket
+-- shall block until the exceptional state ends or at least one downstream
+-- node becomes available for sending; messages are not discarded.
+data Push = Push
+instance SType Push where
+ zmqSocketType = const push
+
+{-# DEPRECATED Up "Use Pull instead." #-}
-- | Socket to receive messages from up the stream. Messages are
-- fair-queued from among all the connected peers. Send function is not
-- implemented for this socket type. /Compatible peer sockets/: 'Down'.
@@ -154,6 +179,7 @@ data Up = Up
instance SType Up where
zmqSocketType = const upstream
+{-# DEPRECATED Down "Use Push instead." #-}
-- | Socket to send messages down stream. Messages are load-balanced
-- among all the connected peers. Send function is not implemented for
-- this socket type. /Compatible peer sockets/: 'Up'.
View
2 src/System/ZMQ/Base.hsc
@@ -64,6 +64,8 @@ newtype ZMQSocketType = ZMQSocketType { typeVal :: CInt } deriving (Eq, Ord)
response = ZMQ_REP,
xrequest = ZMQ_XREQ,
xresponse = ZMQ_XREP,
+ pull = ZMQ_PULL,
+ push = ZMQ_PUSH,
upstream = ZMQ_UPSTREAM,
downstream = ZMQ_DOWNSTREAM
}
View
2 zeromq-haskell.cabal
@@ -1,5 +1,5 @@
name: zeromq-haskell
-version: 0.3.1
+version: 0.4
synopsis: bindings to zeromq
description: Bindings to zeromq (http://zeromq.org)
category: System, FFI

0 comments on commit 9f007a8

Please sign in to comment.
Something went wrong with that request. Please try again.