Open richfitz opened 5 years ago
I have found slackr
to be relatively easy to setup and to have great, flexible functionality. You just need to create a slack app (with the correct permissions) which gives you an API token. I then just have something like this in my cluster function arguments:
message_slack_pars=list(api_token=XXXXXXXXX,
channel="#result_notification",
username="tmp",
message_freq=1000)
And this in the function body:
if(message_slack){
message_slack_pars$username <- username
slackr::slackrSetup(api_token=message_slack_pars$api_token,
channel=message_slack_pars$channel,
username=message_slack_pars$username)
Sys.sleep(runif(1))
slackr::text_slackr(paste0("Starting job ", runName,"_",chainNo))
}
Upon completion:
if(message_slack){
text_slackr(completion_message,
channel="@james",
username=message_slack_pars$username)
if(!is.null(res$p_slack)){
ggslackr(res$p_slack,channel="@james")
}
}
Either server side or client side ideally (client side is after
wait
, server side on job completion).Implement with callbacks for extensibility
Ideas include