Maciek
07/06/2020, 6:18 PMDominaezzz
07/06/2020, 6:22 PMMaciek
07/06/2020, 6:22 PMDominaezzz
07/06/2020, 6:23 PMSharedFlow
, which will let you pause production based on subscriberCount
. It hasn't been released yet though.....Dominaezzz
07/06/2020, 6:24 PMflow { /* loop and emit */ }
Dominaezzz
07/06/2020, 6:24 PMMaciek
07/06/2020, 6:31 PMDominaezzz
07/06/2020, 6:44 PMinitialize
method strictly necessary?Dominaezzz
07/06/2020, 6:45 PMflow
at construction and it won't run until there is a subscriber.Maciek
07/06/2020, 7:14 PMDominaezzz
07/06/2020, 7:17 PMCompletableDeferred
and complete
it in the initialize
method with heavy result. The you can consume the CompletableDeferred
in the flow. This also means that if flow collectors will suspend until initialize
is called.