https://kotlinlang.org logo
#flow
Title
# flow
a

Arun Joseph

03/28/2022, 6:56 PM
Hi, I want callbackflow to be shared between subscribers. I see solutions using shareIn for example - https://barbeau.medium.com/kotlin-callbackflow-a-lightweight-architecture-for-location-aware-android-apps-f97b5e66aaa2. But I would like to avoid an external coroutinescope for shareIn. Is there any solutions which relies on a combination of scopes of the subscribers?
n

Nick Allen

03/28/2022, 11:45 PM
No, you need the separate scope. The shared coroutine can't run directly in either subscriber scope, so it must have its own independent scope.
a

Arun Joseph

03/29/2022, 6:43 PM
At the moment I took an injected scope from the Repository.
15 Views