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, ...)

Arguments

client

the sendeR client which will send a message at end of the regular lapply execution.

X

a vector (atomic or list) to apply FUN to each element. See lapply for more details.

FUN

the function to be applied to each element of X. See lapply for more details.

...

named arguments will be passed to the send_message function. Unnamed arguments will be passed as ... to lapply ultimately being the FUN functions' arguments.

Examples

# 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:") }