rstudio/plumber

Add `is_running()` method

オープン

#910 opened on 2023/06/29

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)R (257 件のフォーク)batch import
difficulty: intermediateeffort: mediumhelp wanted

Repository metrics

Stars
 (1,437 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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.

コントリビューターガイド