This is a helper function to set a timeout on a promise. It is designed to
be used with the magrittr
pipe %>%
.
timeout( x = NULL, delay = 0, msg = paste("The delay of", delay, "seconds expired.\n") )
x | An object. |
---|---|
delay | Number of seconds before rejecting the promise. |
msg | Message if the timeout expires. |
A promise which fulfills when x
fulfills before the delay expires:
in this case, the value of the returned promise is the value of x
. If
x
is not a fulfilled promise when the delay expires, the returned promise
is rejected.