tapchicoma
10/22/2018, 6:55 AMelizarov
10/22/2018, 7:25 AMopenSubscription()
you get a channel, which is hot and keeps observer until you close it.asObservable
it works just like any other hot->cold converter. The underlying channel is not closed, but you can subscribe to it many time, each subscriber receiving its share of events in fan-out faschion.openSubscription
it becomes your duty to ultimately cancel it.tapchicoma
10/22/2018, 7:28 AMdownsteamChannel.invokeOnClose {
upstreamChannel.cancel()
}
work if I insert this somewhere between openSubscription()
and asObservable()
?elizarov
10/22/2018, 7:32 AMconsume
like shown here https://github.com/Kotlin/kotlinx.coroutines/blob/master/reactive/coroutines-guide-reactive.md#subscription-and-cancellationtapchicoma
10/22/2018, 7:45 AM