https://kotlinlang.org logo
#coroutines
Title
# coroutines
m

Matej Drobnič

08/26/2019, 11:03 AM
is there any documentation or samples on how to create my own select clauses? e.g. like I can wrap callback into suspending function I would like to wrap my callback into
SelectClause
so it can get triggered in select statement
From what I see, I have to implement
SelectClause
interface, but its members are internal
I guess I could wrap my callback into suspend function and do
async { mySuspendFunction() }.onAwait
but this seems to be pretty roundabout way of doing it
d

Dominaezzz

08/26/2019, 3:10 PM
I think that's the way to go here.
You're waiting for an async job with select. Although, you probably shouldn't inline it.
👍 1
2 Views