Event Bus with Kotlin suspending functions #38189
-
Hi, everyone! When I have something like this: package foo.bar
import foo.bar.apps.Events
import io.github.oshai.kotlinlogging.KotlinLogging
import io.quarkus.vertx.ConsumeEvent
import jakarta.enterprise.context.ApplicationScoped
@ApplicationScoped
class OnUserCreatedConsumer {
private val logger = KotlinLogging.logger {}
@ConsumeEvent(Events.USER_CREATED)
suspend fun onUserCreated(userId: String) {
logger.info { "Async handler of ${Events.USER_CREATED}: $userId" } /* todo: Send mail */
}
} It fails, saying that the handler function is missing Continuation param. I interpret this as that using Kotlin's suspending functions will not work? Thank You! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
/cc @geoand (kotlin) |
Beta Was this translation helpful? Give feedback.
-
Hi, We don't yet have support for suspend functions for the event bus - see #26728 |
Beta Was this translation helpful? Give feedback.
-
You can use this setup:
You'll need these 2:
|
Beta Was this translation helpful? Give feedback.
Hi,
We don't yet have support for suspend functions for the event bus - see #26728