Learn R Programming

nanonext (version 0.1.0)

send_vec_aio: Send Vector Async

Description

Send any number of R vectors asynchronously over a Socket, with the ability to set (optional) send timeouts. Data will be sent as binary without R serialisation, hence appropriate for interfacing with external programs.

Usage

send_vec_aio(socket, ..., timeout)

Arguments

socket

a Socket.

...

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 {
pub <- socket("pub", dial = "inproc://nanonext")

send_vec_aio(pub, "message 1", "message 2", timeout = 100)
out <- send_vec_aio(pub, "message 1", "message 2", timeout = 100)
out

close(pub)

# }

Run the code above in your browser using DataLab