a library I am using has a suspend function, I am ...
# getting-started
m
a library I am using has a suspend function, I am wondering how can I get a value out of that function without actually making my function suspended?
j
If you're on the JVM or Native, you can block the current thread while you wait for the suspend function call:
Copy code
val result = runBlocking { suspendFunCall() }
m
so return value from
suspendFunCall
would be set in result? and it would block the thread until it gets it back?
👌 1
yep, that is it, ty
j
Yes, sorry for the delay, I was afk. I guess you figured it out 😅