GithubHelp home page GithubHelp logo

kelvinxue / rzmq Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ropensci/rzmq

0.0 2.0 0.0 225 KB

R package for ZMQ

Home Page: http://www.zeromq.org

R 20.71% Makefile 0.22% C 7.74% C++ 71.33%

rzmq's Introduction

Introduction

Date: Sept 27, 2011
Authors: Whit Armstrong
Contact: [email protected]
Web site:http://github.com/armstrtw/rzmq
License:GPL-3

Purpose

rzmq is an R binding for ZMQ (http://www.zeromq.org/).

Features

rzmq is a message queue for serialized R objects.

  • rzmq implements most the standard socket pairs that ZMQ offers.
  • ZMQ devices are not implemented yet, nor is zmq_poll.
  • Look for more features shortly.

Usage

A minimal example of remote execution.

execute this R script on the remote server:

#!/usr/bin/env Rscript
library(rzmq)
context = init.context()
socket = init.socket(context,"ZMQ_REP")
bind.socket(socket,"tcp://*:5555")
while(1) {
    msg = receive.socket(socket);
    fun <- msg$fun
    args <- msg$args
    print(args)
    ans <- do.call(fun,args)
    send.socket(socket,ans);
}

and execute this bit locally:

library(rzmq)

remote.exec <- function(socket,fun,...) {
    send.socket(socket,data=list(fun=fun,args=list(...)))
    receive.socket(socket)
}

substitute(expr)
context = init.context()
socket = init.socket(context,"ZMQ_REQ")
connect.socket(socket,"tcp://localhost:5555")

ans <- remote.exec(socket,sqrt,10000)

rzmq's People

Contributors

armstrtw avatar takluyver avatar glycerine avatar brotchie avatar kelvinxue avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.