-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Make the BackgroundScheduler a singleton #13935
Conversation
4c12d6b
to
c19934d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have concerns about using platform::GetBackgroundScheduler()
directly, rather than being injected? Seems that it more tightly couples those classes.
Could this also affect the tests? We've got a similar thing on iOS where parallel tests are affecting each other due to a shared singleton (and I'm trying to remove the dependency on the singleton in that instance!)
True, however IMO background worker is generic enough to be considered as a part of the project "foundation classes" :) |
b2d93c9
to
31dd705
Compare
657bd0e
to
c3e201c
Compare
c3e201c
to
3011269
Compare
1490fb0
to
dc4195e
Compare
444276d
to
480de64
Compare
480de64
to
02b821d
Compare
d7b108c
to
4403058
Compare
06718e8
to
1f35089
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove benchmark/fixtures/api/cache.db from the PR, maybe add it to .gitignore?
Also, need to be synchronized with #14620, whichever lands first.
- Do not carry it over everywhere as parameter, it is a shared instance anyway and the lifecycle is pretty much the app lifecycle from the moment we instantiate a map. - Rename to BackgroundScheduler because it is a Scheduler that will do tasks in the background, we don't make assumptions if it is a thread pool or a single thread. - Most importantly, remove the dependency from `core` on `platform`.
Simplify, use the default thread pool, less platform abstraction.
1f35089
to
5c355fd
Compare
instance anyway and the lifecycle is pretty much the app lifecycle
from the moment we instantiate a map.
do tasks in the background, we don't make assumptions if it is a
thread pool or a single thread.
core
onplatform
.