Reactor Kotlin Extensions 1.0.0.M1 发布

发布 | Sébastien Deleuze | 2017年3月28日 | ...

更新:Kotlin 现在由 `reactor-core` 和 `reactor-test` 原生支持,无需任何额外的扩展。

我很高兴地宣布 Reactor Kotlin Extensions 的第一个里程碑版本已发布,它为 Reactor API 提供了 Kotlin 扩展。

它支持 Kotlin 类型,如 `KClass`,利用 Kotlin 的具体化类型参数,并提供各种扩展以允许更具表现力的代码。您可以在下面看到 Reactor 在 Java 与 Reactor + Kotlin 扩展的快速对比。

Java Kotlin 配合扩展
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>()` 或 `flux.ofType(Foo::class)`
StepVerifier.create(flux).verifyComplete() flux.test().verifyComplete()

要在您的项目中引用它,请添加 https://repo.spring.io/milestone 仓库和 io.projectreactor:reactor-kotlin-extensions:1.0.0.M1 依赖。

这是第一个里程碑版本,因此请随意在 reactor-kotlin-extensions GitHub 项目上创建 issue 和提交 pull request。

获取 Spring 新闻通讯

通过 Spring 新闻通讯保持联系

订阅

领先一步

VMware 提供培训和认证,助您加速进步。

了解更多

获得支持

Tanzu Spring 提供 OpenJDK™、Spring 和 Apache Tomcat® 的支持和二进制文件,只需一份简单的订阅。

了解更多

即将举行的活动

查看 Spring 社区所有即将举行的活动。

查看所有