Basically WorkManager has assisted injected constructor, you can put there dependencies that live in your custom scope
➕ 1
t
trevjones
01/19/2022, 3:16 AM
WorkerFactoryModule
is install to Singleton and the `androidx.work.Configuration`` is used to initialize inside of a double check lock to ensure a single instance of the factory is created.
Which should mean that the only safe scope to depend on is
Singleton
or unscoped. Scoping the worker itself seems bad given each invocation is going to get its own instance of
WorkerParameters
d
dave08
01/19/2022, 4:07 AM
Yeah, but all worker dependencies are going to live throughout application life... So if multiple dependencies depend on one other, it's either create ot twice, or make it live during the application's lifetime...