Skip to contents

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.

Usage

collect_pipe(x)

Arguments

x

a 'recvAio' object.

Value

A Pipe (object of class ‘nanoPipe’).

Details

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.

Examples

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)
}
#> < nanoPipe >
#>  - id: 1625980946
#> [1] 0

close(s)
close(s1)