Jonathan
02/28/2018, 9:03 AMelizarov
02/28/2018, 9:08 AMproduce {}
. What is your use-case for it?Jonathan
02/28/2018, 9:09 AMprivate val EmptyChannel = produce<Nothing> { }
fun <E> emptyChannel(): ReceiveChannel<E> = EmptyChannel
I just wondered if there was already something. thankselizarov
02/28/2018, 9:13 AMJonathan
02/28/2018, 1:31 PMinterface MyInterface {
fun openEventSubscription(): ReceiveChannel<Event>
}
Of course most implementations would delegate the subscription to a BroadcastChannel
or use produce
to create a channel.
But, in some edges cases and in tests the implementation may simply want to return an empty channel
Do you think it makes sense ? Should I submit an issue or a PR ?