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

bartosz.malkowski

01/04/2018, 10:50 AM
I'm not sure if creating Handler object is best way to do that
v

voddan

01/04/2018, 12:21 PM
You could make
request
into a suspending function. That would mean that it can be called from any coroutine, suspend it, then return a result or throw an exception
suspend fun Client.request(e: Element) {...}
b

bartosz.malkowski

01/04/2018, 12:34 PM
honestly, the main question is how to handle interface with three methods in elegant way 🙂 Does java-way like "object: Handler{…}" is the only solution?
v

voddan

01/04/2018, 2:10 PM
an unusual question for this channel
4 Views