Dear all,
I am writing this in order to understand how I could solve an infrastructure problem.
I have a shinyapp that allows farmers to sign up and report the boundary of the fields.
Following enrollment and input of fields, the shinyapp send a request to the Plumber API which in the backend proceeds to do the downloading of satellite imagery.
Now I would like to understand if it is possible that the shinyapp makes an API request and the plumber API immediately sends a response 200 to the shinyapp so that the user can continue to use the shinyapp and in the meantime the plumber performs in the backend the very long processing of the satellite image
Thanks in advance
Maybe a picture can help to understand my problem.
I tried using this code but the response only comes after the background process which takes over 10 minutes.
#* @tag Satellite
#* @post /SatelliteImages
function(req, res) {
future_promise({
system("RScript yourscript.R &")
})
res$status <- 200
res$body <- "Registration received. Processing of satellite images has finished."
return(res)
}