Learn R Programming

nanonext (version 0.1.0)

ctx_send: Send over Context (Async)

Description

Send any number of R objects asynchronously over a Context, with the ability to set (optional) send timeouts. For sending and receiving within R - objects are sent serialized to ensure perfect reproducibility.

Usage

ctx_send(context, ..., timeout)

Arguments

context

a Context.

...

one or more R objects to send (serialised) asynchronously.

timeout

in ms. If unspecified, a socket-specific default timeout will be used.

Value

A vector of zeros (invisibly) on success.

Details

Will block if the send is in progress and has not yet completed - certain protocol / transport combinations may limit the number of messages that can be queued if they have yet to be received. Set a timeout to ensure the function returns under all conditions.

Examples

Run this code
# NOT RUN {
req <- socket("req", listen = "inproc://nanonext")
rep <- socket("rep", dial = "inproc://nanonext")

ctx <- context(req)
out <- ctx_send(ctx, data.frame(a = 1, b = 2), data.frame(c = 3, d = 4), timeout = 100)
out

close(req)
close(rep)

# }

Run the code above in your browser using DataLab