if (FALSE) {
## remote execution server in rzmq
library(rzmq)
context = init.context()
in.socket = init.socket(context,"ZMQ_PULL")
bind.socket(in.socket,"tcp://*:5557")
out.socket = init.socket(context,"ZMQ_PUSH")
bind.socket(out.socket,"tcp://*:5558")
while(1) {
msg = receive.socket(in.socket)
fun <- msg$fun
args <- msg$args
print(args)
ans <- do.call(fun,args)
send.socket(out.socket,ans)
}
}
Run the code above in your browser using DataLab