rstudio/plumber

Add `is_running()` method

Open

#910 aperta il 29 giu 2023

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)R (257 fork)batch import
difficulty: intermediateeffort: mediumhelp wanted

Metriche repository

Star
 (1437 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

From @nbenn in https://community.rstudio.com/t/determine-whether-code-is-being-run-as-part-of-a-plumber-api/169128

I am looking for a reliable way of determining if code is being run "under" plumber. Something like what I believe shiny::isRunning() provides.

Thanks!


I'd like for it to take pr as a value and have it default to something like get_current_router() (or something) that possibly returns the currently running server and checks for a flag.

Could also have a method to return currently running plumber routers (if non-blocking) is implemented. And then the length of the routers could be checked for > 0.

Guida contributor