Seems like I should be able to wrap a ReceiveChann...
# coroutines
s
Seems like I should be able to wrap a ReceiveChannel in a Sequence to pass it to another library.
o
sequences are using coroutines for non-async purposes, so you can't do it without
runBlocking
or similar
it's probably not supported by default for this reason
s
I want something like
launch { someExternalLibrary.process( channel.asSequence() ) }
o
yes, but sequences are not coroutine-enabled outside of the
sequence {}
builder
so it's still blocking code
you could probably write a similar api to sequences, that is fully async, but there's not a current primitive for it, because I think ReceiveChannel already has a lot of the features in it
d
Copy code
sequence {
    yield(runBlocking { channel.receive() })
}