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
* Add additional check in SafeCollector with an error message pointing to channelFlow
* Improve performance of the CoroutineId check in SafeCollector
Fixes#1210
val previousJob = observedContext[Job].transitiveCoroutineParent()
45
+
val currentJob = currentContext[Job].transitiveCoroutineParent()
46
+
check(previousJob === currentJob) { "Flow invariant is violated: emissions from different coroutines are detected ($currentContext and $lastEmissionContext). "+
47
+
"FlowCollector is not thread-safe and concurrent emissions are prohibited. To mitigate this restriction please use 'flowChannel' builder instead of 'flow'" }
0 commit comments