pipe_notify | R Documentation |
Signals a 'conditionVariable' whenever pipes (individual connections) are added or removed at a socket.
pipe_notify(socket, cv, add = FALSE, remove = FALSE, flag = FALSE)
socket |
a Socket. |
cv |
a 'conditionVariable' to signal, or NULL to cancel a previously set signal. |
add |
[default FALSE] logical value whether to signal (or cancel signal) when a pipe is added. |
remove |
[default FALSE] logical value whether to signal (or cancel signal) when a pipe is removed. |
flag |
[default FALSE] logical value whether to also set a flag in the
'conditionVariable'. This can help distinguish between different types of
signal, and causes any subsequent |
For add: this event occurs after the pipe is fully added to the socket. Prior to this time, it is not possible to communicate over the pipe with the socket.
For remove: this event occurs after the pipe has been removed from the socket. The underlying transport may be closed at this point, and it is not possible to communicate using this pipe.
Invisibly, zero on success (will otherwise error).
s <- socket(listen = "inproc://nanopipe")
cv <- cv()
pipe_notify(s, cv, add = TRUE, remove = TRUE, flag = TRUE)
cv_value(cv)
s1 <- socket(dial = "inproc://nanopipe")
cv_value(cv)
reap(s1)
cv_value(cv)
pipe_notify(s, NULL, add = TRUE, remove = TRUE)
s1 <- socket(dial = "inproc://nanopipe")
cv_value(cv)
reap(s1)
(wait(cv))
close(s)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.