Do you think passing a `CompletableDeferred` down ...
# coroutines
l
Do you think passing a
CompletableDeferred
down a
Flow
or a
Channel
(exposed as a
ReceiveChannel
) is a good idea? The use case is to allow to observe a state (a sealed class instance), and allow an action depending on that state.
u
Why not just send the state change as a regular value over the channel?
1
l
The state change already passes down the flow/channel. What I'm looking for is allowing an action just for that state (obsolete when the state changes).
s
Is this somewhat like what is used on RxAndroidBle where connecting to a device emits an Observable that represents the connection-setup and then observing that emitted Observable will yield a Connection?
z
That's common in CSP systems I think. You send a message to a process, and that message contains a dedicated channel just for sending responses back.