I'm trying to make firebase-admin calls coroutine-...
# coroutines
p
I'm trying to make firebase-admin calls coroutine-friendly. The api call returns an ApiFuture. I want to wrap that in a suspend function with a set timeout. The attached code is my approach to it but the timeout never seem to trigger if the third party request stalls for whatever reason. I'm trying to figure out if this is at all a sane approach or if I'm doing something wrong. Can I expect the
withTimeout
to trigger an exception after 5 seconds of no response?
a
try
suspendCancellableCoroutine
instead of
suspendCoroutine
p
Tests passed: 1
Thanks a bunch!
👍 1