Open ColinFay opened 2 years ago
Example skeleton:
library(promises)
library(future.callr)
plan(callr, workers = 2L)
#* @post /async_endpoint
function(req, res, callback) {
if (missing(callback))
callback <- NULL
promises::future_promise({
FUN(..., callback = callback)
})
list("Async job started")
}
Following a conversation with @psolymos:
Create a add_endpoint_async that will create the skeleton for a promise based endpoint handler.
Maybe add the information in the YAML so that when building the plumber.R file and running the API in run_dev