MyNixOS website logo
Description

Programming with Big Data -- Interface to 'ZeroMQ'.

'ZeroMQ' is a well-known library for high-performance asynchronous messaging in scalable, distributed applications. This package provides high level R wrapper functions to easily utilize 'ZeroMQ'. We mainly focus on interactive client/server programming frameworks. For convenience, a minimal 'ZeroMQ' library (4.2.2) is shipped with 'pbdZMQ', which can be used if no system installation of 'ZeroMQ' is available. A few wrapper functions compatible with 'rzmq' are also provided.

pbdZMQ

  • License:License
  • Download:Download
  • Status:Build Status Appveyor Build status
  • Author: See section below.

pbdZMQ is an R package providing a simplified interface to ZeroMQ with a focus on client/server programming frameworks. Notably, pbdZMQ should allow for the use of ZeroMQ on Windows platforms.

Interfaces

The package contains 2 separate interfaces:

  1. One modeled after the ZeroMQ C interface (see help("czmq"))
  2. One modeled after the rzmq interface (see help("rzmq"))

Client/Server Example

The primary focus of pbdZMQ is for building client/server interfaces for R. An example of this can be found in the pbdCS package, which uses this model to control batch MPI servers interactively. There are also several illustrative examples in the pbdZMQ package vignette.

The basic idea is that you need a server R process, and a separate client R process. For demonstration/simplicity, assume they are both running on the same machine. The server we describe here is very basic. You can see a more detailed example in the pbdZMQ package vignette.

Server

Save the following as, say, server.r and run it in batch by running Rscript server.r from a terminal.

library(pbdZMQ)
ctxt <- init.context()
socket <- init.socket(ctxt, "ZMQ_REP")
bind.socket(socket, "tcp://*:55555")


cat("Client command:  ")
  msg <- receive.socket(socket)

cat(msg, "\n")
send.socket(socket, "Message received!")

Client

From an interactive R session (not in batch), enter the following:

library(pbdZMQ)
ctxt <- init.context()
socket <- init.socket(ctxt, "ZMQ_REQ")
connect.socket(socket, "tcp://localhost:55555")

send.socket(socket, "1+1")
receive.socket(socket)

If all goes well, your message should be sent from the client to the server, before your server terminates.

For an example of how to do this more persistently, see the pbdZMQ package vignette.

Installation

pbdZMQ requires

  • R version 3.0.0 or higher.
  • Linux, Mac OSX, Windows, or FreeBSD.
  • libzmq >= 4.0.4.
  • Solaris 10 requiring external libzmq 4.0.7 and OpenCSW.

A distribution of libzmq is shipped with pbdZMQ for convenience. However, if you already have a system installation of ZeroMQ, then it is simple to use that with pbdZMQ. Full details on installation and troubleshooting can be found in the package vignette, located at inst/doc/pbdZMQ-guide.pdf of the pbdZMQ source tree.

The package can be installed from the CRAN via the usual install.packages("pbdZMQ"), or via the devtools package:

library(devtools)
install_github("RBigData/pbdZMQ")

Citation

When mentioning the pbdZMQ, please cite:

@MISC{pbdZMQ2015,
  author = {Chen, W.-C. and Schmidt, D. and Heckendorf, C. and Ostrouchov, G.},
  title = {pbdZMQ: Programming with Big Data -- Interface to ZeroMQ},
  year = {2015},
  note = {R Package, URL https://cran.r-project.org/package=pbdZMQ}
}

Authors

pbdZMQ is authored and maintained by:

  • Wei-Chen Chen
  • Drew Schmidt
  • Christian Heckendorf
  • George Ostrouchov

With additional contributions and authors from:

  • Whit Armstrong (some functions are modified from rzmq for backwards compatibility)
  • Brian Ripley (C code of shellexec)
  • The R Core team (some functions are modified from the R source code)
  • Philipp A. (Fedora)
  • Elliott Sales de Andrade (sprintf version underflow)
  • Spencer Aiello (windows conf spacing)
  • Paul Andrey (Mac OSX conf)
  • Panagiotis Cheilaris (serialize version)
  • Jeroen Ooms (clang++ on MacOS ARM64)
  • ZeroMQ Authors (source files in 'src/zmq_src/')

For the distribution of ZeroMQ that is shipped with pbdZMQ, you can find details of authorship and copyright in inst/zmq_copyright/ of the pbdZMQ source tree, or under zmq_copyright/ of a binary installation of pbdZMQ.

Metadata

Version

0.3-11

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • 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