ruby-concurrency / ruby-concurrency/concurrent-ruby
Copy select thread local state of calling thread into workers
@pitr-ch がすでに取り組んでいます。
2018年7月6日 から。
- 主要言語
- Ruby
- スター
- 5.8k
- フォーク
- 420
- 平均マージ
- 20時間 45分
- マージ済み PR(30日)
- 4
説明
This is a suggestion.
I was recently faced with a problem in a Rails app using Futures where log content that was run by a Future task did not contain a request uuid. It turns out that Rails stores this log related data in thread locals. To work around this, I decided to patch the ThreadPoolExecutor Worker to copy select local thread state from the invoking thread to the worker thread when it receives a message to execute.
Suggestion: through configuration / call arguments, allow workers to copy select thread state prior to performing tasks.
I believe thread synchronization models in other languages / tools support this, for instance .NET allows thread context to be shared among threads: https://msdn.microsoft.com/magazine/gg598924.aspx.
Do the ruby-concurrency team believe this idea has merit?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。