This function retrieves the Pipe used to receive a message from the Aio. It will block if the Aio has yet to complete. The message is still available for retrieval by the usual means. A Pipe is a low-level object and it is not normally necessary to deal with them directly.
collect_pipe(x)
A Pipe (object of class ‘nanoPipe’).
a 'recvAio' object.
As Pipes are always owned by a Socket, removing (and garbage collecting) a Pipe does not close it or free its resources. A Pipe may, however, be explicitly closed.
s <- socket("rep", listen = "inproc://nanonext")
s1 <- socket("req", dial = "inproc://nanonext")
r <- recv_aio(s, timeout = 500)
if (!send(s1, "")) {
p <- tryCatch(collect_pipe(r), error = identity)
print(p)
reap(p)
}
close(s)
close(s1)
Run the code above in your browser using DataLab