We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This issue was discovered analytically, by reading the source code. No one reported it yet.
val threadLocal = ThreadLocal<String>.withInitial { "default" } @Test fun testFlowOnThreadContext() = runBlocking { val publisher = Publisher<Int> { it -> it.onSubscribe(object : Subscription { override fun request(n: Long) { assertEquals("value", threadLocal.get()) it.onNext(1) it.onComplete() } override fun cancel() {} }) } val context1 = Dispatchers.IO + threadLocal.asContextElement("value") val context2 = threadLocal.asContextElement("value") // succeeds publisher.asFlow().flowOn(context1).collect { } // fails with org.junit.ComparisonFailure: expected:<[value]> but was:<[default]> publisher.asFlow().flowOn(context2).collect { } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This issue was discovered analytically, by reading the source code. No one reported it yet.
The text was updated successfully, but these errors were encountered: