It would be great to have Mutiny support in this project for CoroutineVerticle as Mutiny is now a preferred Reactive API and has support for Coroutines. This would allow mixing of Reactive APIs with Mutiny with the Coroutines via suspend fun.
Here is some working example code to make it possible to use the io.smallrye.mutiny.coroutines.awaitSuspending with the CoroutineVerticle.
import io.vertx.core.Context
import io.vertx.kotlin.coroutines.CoroutineVerticle
import io.vertx.kotlin.coroutines.dispatcher
import io.vertx.mutiny.core.Vertx
import kotlinx.coroutines.SupervisorJob
import kotlin.coroutines.CoroutineContext
abstract class MutinyCoroutineVerticle : CoroutineVerticle() {
protected lateinit var vertx: Vertx
private lateinit var context: Context
override val coroutineContext: CoroutineContext by lazy { context.dispatcher() + SupervisorJob() }
override fun init(vertx: io.vertx.core.Vertx, context: Context) {
this.vertx = Vertx(vertx)
this.context = context
}
}
It would be great to have Mutiny support in this project for
CoroutineVerticle
as Mutiny is now a preferred Reactive API and has support for Coroutines. This would allow mixing of Reactive APIs with Mutiny with the Coroutines viasuspend fun
.Here is some working example code to make it possible to use the
io.smallrye.mutiny.coroutines.awaitSuspending
with theCoroutineVerticle
.Here is an example of using
awaitSuspending()
.