You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "SDK 31 Main Thread @coroutine#76" java.lang.IllegalStateException: Calling context is suspending; use a suspending method instead
at app.cash.turbine.CoroutinesKt.assertCallingContextIsNotSuspended(coroutines.kt:67)
I received this crash because I'm using Turbine#takeItem() from a non-suspending function:
val results = Turbine<Foo>()
fun foo(): Result {
return results.takeItem()
}
I can probably make it suspending to fix the problem, but I was wondering if assertCallingContextIsNotSuspended() should only check the last stack item instead of finding an instance of invokeSuspend in the entire call chain?
The text was updated successfully, but these errors were encountered:
I received this crash because I'm using
Turbine#takeItem()
from a non-suspending function:I can probably make it suspending to fix the problem, but I was wondering if
assertCallingContextIsNotSuspended()
should only check the last stack item instead of finding an instance ofinvokeSuspend
in the entire call chain?The text was updated successfully, but these errors were encountered: