Closed bbyk closed 1 year ago
I think the behavior is right but the doc is wrong.
The purpose of io.vertx.kotlin.coroutines.VertxCoroutineKt#dispatcher(io.vertx.core.Context)
is to launch coroutines on the corresponding context. And inside awaitBlocking
, we're still on the same Vert.x context (but on a worker thread).
If that's fine with you @vietj , I'll update the doc
In fact, this was indeed a bug, which has been fixed by https://github.com/vert-x3/vertx-lang-kotlin/pull/237
Questions
Starting a coroutine on a vert.x worker thread ends up running it inline, that is on the very same thread, instead of the event loop thread. This seems like a bug because it contradicts the KDoc on Context.dispatcher()
Version
vert.x 4.1.5, kotlin 1.5.31, coroutines 1.5.2
Context
VertxCoroutineExecutor
I suspect the code might be lacking a check for
isOnWorkerThread
e.g. the if-statement should look like:Do you have a reproducer?
Prints