zeromq-haskell 0.2.2 → 0.3
raw patch · 11 files changed
+20/−36 lines, 11 files
Files
- README +2/−2
- src/System/ZMQ.hs +8/−20
- src/System/ZMQ/Base.hsc +2/−6
- test/display.hs +1/−1
- test/perf/local_lat.hs +1/−1
- test/perf/local_thr.hs +1/−1
- test/perf/remote_lat.hs +1/−1
- test/perf/remote_thr.hs +1/−1
- test/poll.hs +1/−1
- test/prompt.hs +1/−1
- zeromq-haskell.cabal +1/−1
README view
@@ -3,10 +3,10 @@ · Current status -Version 0.2.x - This software currently has *alpha* status, i.e. it had+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. -This software was developed and tested on Linux 2.6.31 with GHC-6.12.1+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).
src/System/ZMQ.hs view
@@ -22,7 +22,7 @@ Poll(..), PollEvent(..), - P2P(..),+ Pair(..), Pub(..), Sub(..), Req(..),@@ -86,10 +86,10 @@ -- | Socket to communicate with a single peer. Allows for only a -- single connect or a single bind. There's no message routing--- or message filtering involved. /Compatible peer sockets/: 'P2P'.-data P2P = P2P-instance SType P2P where- zmqSocketType = const p2p+-- or message filtering involved. /Compatible peer sockets/: 'Pair'.+data Pair = Pair+instance SType Pair where+ zmqSocketType = const pair -- | Socket to distribute data. 'receive' function is not -- implemented for this socket type. Messages are distributed in@@ -172,13 +172,6 @@ -- of the pipe. -- /Default/: 0 ----- [@LowWM@] Low watermark makes sense only if high watermark is--- defined (i.e. is non-zero). When the emergency state is--- reached when messages overflow the pipe, the emergency lasts--- at most till the size of the pipe decreases to low watermark.--- Normal state is resumed at that point.--- /Default/: 0--- -- [@Swap@] Swap allows the pipe to exceed high watermark. However, -- the data are written to the disk rather than held in the memory. -- Until high watermark is exceeded there is no disk activity involved@@ -236,7 +229,6 @@ -- data SocketOption = HighWM Int64 -- ^ ZMQ_HWM- | LowWM Int64 -- ^ ZMQ_LWM | Swap Int64 -- ^ ZMQ_SWAP | Affinity Int64 -- ^ ZMQ_AFFINITY | Identity String -- ^ ZMQ_IDENTITY@@ -270,12 +262,9 @@ | F Fd PollEvent -- | Initialize a 0MQ context (cf. zmq_init for details).-init :: Size -> Size -> Bool -> IO Context-init appThreads ioThreads doPoll = do- c <- throwErrnoIfNull "init" $- c_zmq_init (fromIntegral appThreads)- (fromIntegral ioThreads)- (if doPoll then usePoll else 0)+init :: Size -> IO Context+init ioThreads = do+ c <- throwErrnoIfNull "init" $ c_zmq_init (fromIntegral ioThreads) return (Context c) -- | Terminate 0MQ context (cf. zmq_term).@@ -300,7 +289,6 @@ -- functions. setOption :: Socket a -> SocketOption -> IO () setOption s (HighWM o) = setIntOpt s highWM o-setOption s (LowWM o) = setIntOpt s lowWM o setOption s (Swap o) = setIntOpt s swap o setOption s (Affinity o) = setIntOpt s affinity o setOption s (Identity o) = setStrOpt s identity o
src/System/ZMQ/Base.hsc view
@@ -47,9 +47,6 @@ #{poke zmq_pollitem_t, events} p e #{poke zmq_pollitem_t, revents} p re -usePoll :: CInt-usePoll = #const ZMQ_POLL- type ZMQMsgPtr = Ptr ZMQMsg type ZMQCtx = Ptr () type ZMQSocket = Ptr ()@@ -60,7 +57,7 @@ newtype ZMQSocketType = ZMQSocketType { typeVal :: CInt } deriving (Eq, Ord) #{enum ZMQSocketType, ZMQSocketType,- p2p = ZMQ_P2P,+ pair = ZMQ_PAIR, pub = ZMQ_PUB, sub = ZMQ_SUB, request = ZMQ_REQ,@@ -75,7 +72,6 @@ #{enum ZMQOption, ZMQOption, highWM = ZMQ_HWM,- lowWM = ZMQ_LWM, swap = ZMQ_SWAP, affinity = ZMQ_AFFINITY, identity = ZMQ_IDENTITY,@@ -105,7 +101,7 @@ -- general initialization foreign import ccall unsafe "zmq.h zmq_init"- c_zmq_init :: CInt -> CInt -> CInt -> IO ZMQCtx+ c_zmq_init :: CInt -> IO ZMQCtx foreign import ccall unsafe "zmq.h zmq_term" c_zmq_term :: ZMQCtx -> IO CInt
test/display.hs view
@@ -12,7 +12,7 @@ hPutStrLn stderr "usage: display <address>" exitFailure let addr = head args- c <- ZMQ.init 1 1 False+ c <- ZMQ.init 1 s <- ZMQ.socket c ZMQ.Sub ZMQ.subscribe s "" ZMQ.connect s addr
test/perf/local_lat.hs view
@@ -14,7 +14,7 @@ let bindTo = args !! 0 size = read $ args !! 1 rounds = read $ args !! 2- c <- ZMQ.init 1 1 False+ c <- ZMQ.init 1 s <- ZMQ.socket c ZMQ.Rep ZMQ.bind s bindTo loop s rounds size
test/perf/local_thr.hs view
@@ -16,7 +16,7 @@ let bindTo = args !! 0 size = read $ args !! 1 :: Int count = read $ args !! 2 :: Int- c <- ZMQ.init 1 1 False+ c <- ZMQ.init 1 s <- ZMQ.socket c ZMQ.Sub ZMQ.subscribe s "" ZMQ.bind s bindTo
test/perf/remote_lat.hs view
@@ -16,7 +16,7 @@ size = read $ args !! 1 rounds = read $ args !! 2 message = SB.replicate size 0x65- c <- ZMQ.init 1 1 False+ c <- ZMQ.init 1 s <- ZMQ.socket c ZMQ.Req ZMQ.connect s connTo start <- getCurrentTime
test/perf/remote_thr.hs view
@@ -16,7 +16,7 @@ size = read $ args !! 1 count = read $ args !! 2 message = SB.replicate size 0x65- c <- ZMQ.init 1 1 False+ c <- ZMQ.init 1 s <- ZMQ.socket c ZMQ.Pub ZMQ.connect s connTo replicateM_ count $ ZMQ.send s message []
test/poll.hs view
@@ -12,7 +12,7 @@ when (length args /= 1) $ do hPutStrLn stderr usage exitFailure- c <- ZMQ.init 1 1 True+ c <- ZMQ.init 1 s <- ZMQ.socket c ZMQ.Rep let bindTo = head args toPoll = [ZMQ.S s ZMQ.In]
test/prompt.hs view
@@ -16,7 +16,7 @@ exitFailure let addr = args !! 0 name = SB.append (SB.fromString $ args !! 1) ": "- c <- ZMQ.init 1 1 False+ c <- ZMQ.init 1 s <- ZMQ.socket c ZMQ.Pub ZMQ.connect s addr forever $ do
zeromq-haskell.cabal view
@@ -1,5 +1,5 @@ name: zeromq-haskell-version: 0.2.2+version: 0.3 synopsis: bindings to zeromq description: Bindings to zeromq (http://zeromq.org) category: System, FFI