Function is a wrapper for standard lapply
. The
sendeR_lapply
after performing the regular lapply
executes
client
argument's send_message
method thus notifying
the user that lapply
has finished.
sendeR_lapply(client, X, FUN, ...)
client | the sendeR client which will send a message at end of the
regular |
---|---|
X | a vector (atomic or list) to apply |
FUN | the function to be applied to each element of |
... | named arguments will be passed to the |
# Using regular client client <- client_telegram("my_token") if (FALSE) { my_func <- function(x, text) { print(paste(text, x)); Sys.sleep(x) } sendeR_lapply(client, 1:10, my_func, "Sleeping:", destination = 12345, message = "sendeR_lapply done!") } # Using client with set fields client_with_fields <- set_fields(client, message = "sendeR_lapply is done!", destination = 12345) if (FALSE) { sendeR_lapply(client_with_fields, 1:10, my_func, "Sys.sleep:") }