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 分钟
- 30 天内合并 PR
- 4
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby-concurrency/concurrent-ruby 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
ruby-concurrency/concurrent-ruby#1118 ·
-
难度 4/5 3-5 天 新手友好度 35/100
ruby-concurrency/concurrent-ruby#1099 · 9 条评论 ·
-
难度 5/5 一周以上 新手友好度 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