Hi guys. I’m using the library Fuel for Kotlin: <...
# announcements
g
Hi guys. I’m using the library Fuel for Kotlin: https://github.com/kittinunf/Fuel It’s very nice. But I was wondering, instead of doing some complex code like we usually did in JavaScript before, Kotlin (or can we find a way) to use some kind of `await`operator? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await For example:
Copy code
val (request, response, result) = await "<http://httpbin.org/get>".httpGet().responseString()
instead of
Copy code
val (request, response, result) = "<http://httpbin.org/get>".httpGet().responseString() // without await and thread blocking
a
from a glance at the README, it has an async mode, so could definitely be wrapped up to return a Deferred and be awaited by a coroutine (= suspending function)
given the README also mentions a fuel-coroutines library, it seems likely the author knows/has already done this
g
Hum, thanks @araqnid. I will take a look. Thanks a lot.