Reactor Kotlin 扩展 1.0.0.M1 发布

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

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

我很高兴地宣布 Reactor Kotlin 扩展的第一个里程碑版本发布,它为 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 社区中所有即将举行的活动。

查看全部