coroutineHandler
fun Route.coroutineHandler(coroutineScope: CoroutineScope, context: CoroutineContext, start: CoroutineStart, requestHandler: suspend (RoutingContext) -> Unit): Route(source)
This function can be replaced by coroutineRouter and CoroutineRouterSupport.coHandler which is newly introduced to the official "vertx-lang-kotlin-coroutines" library. However, note that CoroutineRouterSupport.coHandler handles exceptions and is equivalent to Route.checkedCoroutineHandler. See the official docs for more details.
This function is not deprecated yet and can still serve its purpose in some scenarios because the approach above is still a bit ugly for the lack of context parameters.
fun Route.coroutineHandler(coroutineScope: CoroutineScope, launchMode: CoroutineHandlerLaunchMode = DefaultOnVertxEventLoop, requestHandler: suspend (RoutingContext) -> Unit): Route(source)
fun coroutineHandler(coroutineScope: CoroutineScope, route: Route, launchMode: CoroutineHandlerLaunchMode = DefaultOnVertxEventLoop, requestHandler: suspend (RoutingContext) -> Unit): Route(source)
Deprecated
Use the extension version.
Replace with
route.coroutineHandler(coroutineScope, launchMode, requestHandler)
Content copied to clipboard