Drop Delay from global config
@eregon がすでに取り組んでいます。
2023年1月23日 から。
評価
この issue はまだ評価されていません。
説明
One of the biggest barriers to using autoload w/i this gem is the circular reference caused by the use of Delay within the global config. I no longer feel that we need to use Delay in the global config and I would like to remove it. I'd like some feedback from the community on this.
A bit of history...
The earliest versions of our thread pools spawned threads on construction. This meant that applications using c-r would always spawn a few background threads, even when they never post jobs (Rails and Sidekiq are good examples). To prevent this I used Delay to lazy-load the thread pools. This added a slight performance hit every time a job was post to a global thread pool because Delay objects are synchronized, but that seemed like a fair price to pay.
Later I decided to make the global thread pools configurable. This eventually lead us to add a reconfigure option on Delay. This, in turn, lead to the addition of a timeout option on Delay's #value call. To be consistent with everything else in this gem, Delay was updated to use the common executor options helper and default to a global thread pool. Hence, the circular reference.
Two things have changed since then that completely change the nature of this problem:
- Our thread pools now lazy-load threads so no threads are created until the first job is post
- We've removed the ability for the user to change the global thread pools (preferring dependency injection on the individual classes)
Subsequently, the use of Delay in the global config seems to provide little value. I think it can safely be removed. Removing it should give a tiny performance improvement every time a job is post to a global thread pool. More importantly, I can remove the circular reference that's been plaguing me.
Thoughts?
- 主要言語
- Ruby
- スター
- 5.8k
- フォーク
- 420
- 平均マージ
- 20時間 45分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby-concurrency/concurrent-ruby のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
ruby-concurrency/concurrent-ruby#1118 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
ruby-concurrency/concurrent-ruby#1099 · コメント 9 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ruby-concurrency/concurrent-ruby#1095 · コメント 8 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
ruby-concurrency/concurrent-ruby#1093 · コメント 3 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
ruby-concurrency/concurrent-ruby#1091 ·
ruby-concurrency/concurrent-ruby の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
バグ
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
voxpupuli/puppet-epel#186 · コメント 1 件 ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) オープンBug Frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100