aio_collect
collects the data of an Aio or list of Aios, waiting for
resolution if still in progress.
aio_collect_
is a variant that allows user interrupts, suitable for
interactive use.
Usage
aio_collect(x)
aio_collect_(x)
Arguments
- x
an Aio or list of Aios (objects of class ‘sendAio’,
‘recvAio’ or ‘ncurlAio’).
Value
Depending on the type of ‘x’ supplied, an object or list of
objects (the same length as ‘x’, preserving names).
Details
This function will wait for the asynchronous operation(s) to
complete if still in progress (blocking).
Examples
s1 <- socket("pair", listen = "inproc://nanonext")
s2 <- socket("pair", dial = "inproc://nanonext")
res <- send_aio(s1, data.frame(a = 1, b = 2), timeout = 100)
aio_collect(res)
#> [1] 0
msg <- recv_aio(s2, timeout = 100)
aio_collect_(res)
#> [1] 0
close(s1)
close(s2)