Reactor Kotlin Extensions 1.0.0.M1 released
Update: Kotlin is now natively supported by reactor-core and reactor-test without requiring any additional extensions.
I am excited to announce the release of the first milestone of Reactor Kotlin Extensions, which provides Kotlin extensions for Reactor API.
It provides support for Kotlin types like KClass, takes advantage of Kotlin reified type parameters and provide various extensions to allow more expressive code. You can see bellow a quick comparaison of Reactor with Java versus Reactor with Kotlin + extensions.
| Java | Kotlin with extensions |
|---|---|
Mono.just("foo") |
"foo".toMono() |
Flux.fromIterable(list) |
list.toFlux() |
Mono.error(new RuntimeException()) |
RuntimeException().toMono() |
Flux.error(new RuntimeException()) |
RuntimeException().toFlux() |
flux.ofType(Foo.class) |
flux.ofType<Foo>() or flux.ofType(Foo::class) |
StepVerifier.create(flux).verifyComplete() |
flux.test().verifyComplete() |