MyNixOS website logo
Description

Bindings to ZeroMQ 3.x.

The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. 0MQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more. This library provides the Haskell language binding to 0MQ >= 3.2.2

This library provides Haskell bindings to 0MQ 3.2.x (http://zeromq.org). API documentation can be found at: http://twittner.github.io/zeromq-haskell/

Current status

This software currently has beta status, i.e. it had seen limited testing.

Version 0.5 - Poll has an additional type-parameter representing the socket type. This integrates poll with the monadic layer.

Version 0.4 - Return Async a in System.ZMQ3.Monadic.async. Also require Data.List.NonEmpty in System.ZMQ3.sendMulti.

Version 0.3 - Add monadic layer on top of System.ZMQ3 and substitute String for ByteString in a number of cases, where the 0MQ API speaks of "binary data", i.e. subscribe/unsubscribe, identity/setIdentity and setTcpAcceptFilter.

Version 0.2 - Add additional functionality from 3.2 stable release, e.g. zmq_proxy support, new socket options, socket monitoring etc. API Change: withContext no longer accepts the number of I/O threads as first argument.

Version 0.1.4 - Expose waitRead and waitWrite.

Version 0.1.3 - Deprecated Xreq, XRep in favour of Dealer and Router as in libzmq. Fixes to compile and run with GHC 7.4.1.

Version 0.1.2 - Add sendMulti and receiveMulti. Rename SndMore to SendMore.

Version 0.1.1 - Include better error message when trying to build against invalid 0MQ version.

Version 0.1 - First release to provide bindings against 0MQ 3.1.0

Installation

As usual for Haskell packages this software is installed best via Cabal (http://www.haskell.org/cabal). In addition to GHC it depends on 0MQ 3.1.x of course.

Notes

zeromq3-haskell mostly follows 0MQ's API. One difference though is that sockets are parameterized types, i.e. there is not one single socket type but when creating a socket the desired socket type has 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.

Other differences are mostly for convenience. Also one does not deal directly with 0MQ messages, instead these are created internally as needed.

Finally note that receive is already non-blocking internally. GHC's I/O manager is used to wait for data to be available, so from a client's perspective receive appears to be blocking.

Differences to the 0MQ 2.x binding

This library is based on the zeromq-haskell binding for 0MQ 2.x. Socket types and options have been aligned with 0MQ 3.x and instead of using a big SocketOption datatype, this library provides separate get and set functions for each available option, e.g. affinity/setAffinity. For details, please refer to the module's haddock documentation.

Examples

The examples folder contains some simple tests mostly mimicking the ones that come with 0MQ.

Bugs

If you find any bugs or other shortcomings I would greatly appreciate a bug report, preferably via http://github.com/twittner/zeromq-haskell/issues or e-mail to [email protected].

Metadata

Version

0.5.2

License

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows