So `Flow.conflate()` allows emitter to never suspe...
# coroutines
d
So
Flow.conflate()
allows emitter to never suspend but is there an operator to allow the collector to never suspend (too)?
j
.buffer(UNLIMITED)
?
d
If the emitter pauses, I need the collector to repeatedly get the last value.
j
oh. that's... weird. you could write this yourself and just
while (true) { send(latest) }
in its own coroutine separate from the collector which updates latest (for conflate-like behavior).
d
Use case: I have a
Flow<Boolean>
(a stream of connection statuses) and
Flow<Task>
(a stream of tasks). I need to process the flow of tasks while the latest value from the first flow is
true
.
Nice, your solution works well with
transformLatest
.
z
Sounds like you could just use a
withLatestFrom
operator, as in RxJava? (Doesn't exist for flow right now)