Scope of future plan
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- r
調査の方向性
まず plan() と future() の動作を確認し、issue で言及されている persistent=TRUE オプションも含めて検討してから、リンク先の future バックエンド仕様を読んでください。セッションスコープのプランとクラスタ状態が、個別の Shiny セッションでサポートされているかを判断し、期待される動作の例を添えて、必要な変更を文書化するか、その範囲を定めてください。
索引モデルが issue の本文から書いたものです。
説明
Hi,
Is it possible to have a plan being valid in a specific scope of a R session only, i.e. to have multiple plans in the same R session?
I know it is possible to specify the workers for the plan, but is it possible to have multiple plans? future({}) does not seem to have an option for specifying a plan either.
cl <- parallel::makePSOCKcluster(1L,rscript_libs='E:/rpackages')
parallel::clusterEvalQ(cl, { .libPaths('E:/rpackages') })
plan(cluster, workers = cl)
The reason I'm asking is because I would like to have separate plans/clusters for different shiny sessions that run in the same R process. The workers of the clusters need to do some setup and I'd like that to be specific to the user session only.
The idea I would have had was to rerun the plan() command before each future call, but that could mess up the promises later in the event loop?
Edit: Attached to the same question ("linking a cluster to a session") I wanted to ask whether it is possible to keep the state of a cluster after a future. I tried to assign objects to the global environment but in the following future run they all seem gone. This makes sense in the paradigm of futures being indifferent to who calls them, but as said my goal is to link a specific cluster to a session (and e.g. keep some base data in the cluster which I don't want to re-query each time).
I potentially could re-implement it with https://cran.r-project.org/web/packages/future/vignettes/future-6-future-api-backend-specification.html but I was hoping there is some trick/setting that I'm just not aware of.
It looks like constantly using the persistent=TRUE flag works in f <- future({...},persistent=TRUE). Found it by looking at the source code. Please let me know if this is not the right way to do it / think about it.
Best regards
- 主要言語
- R
- スター
- 1k
- フォーク
- 93
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
futureverse/future のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
futureverse/future#852 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
futureverse/future#849 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
futureverse/future#833 ·
-
feature/resources RNG
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
futureverse/future#832 ·
-
RNG
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
futureverse/future#831 · コメント 1 件 ·
futureverse/future の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nf-core/provenancereport#75 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
garner-code/PsyR#80 ·