• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

reactor/reactor-kotlin-extensions: Reactor Kotlin Support

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

reactor/reactor-kotlin-extensions

开源软件地址(OpenSource Url):

https://github.com/reactor/reactor-kotlin-extensions

开源编程语言(OpenSource Language):

Kotlin 98.9%

开源软件介绍(OpenSource Introduction):

Reactor Kotlin Extensions

Join the chat at https://gitter.im/reactor/reactor

Add various extensions and adapters for Kotlin programming language. While Reactor Core, Reactor Addons and other Reactor libraries are designed to be Kotlin friendly with the use of @Nullable and carefully picked signature types, Kotlin developers might want to adapt the core functional programming API further.

Maven Artifacts

With Gradle from repo.spring.io or Maven Central repositories (stable releases only):

    repositories {
        //maven { url 'https://repo.spring.io/snapshot' }
        maven { url 'https://repo.spring.io/milestone' }
        mavenCentral()
    }

    dependencies {
        //implementation "io.projectreactor.kotlin:reactor-kotlin-extensions:1.2.0-SNAPSHOT"
        implementation "io.projectreactor.kotlin:reactor-kotlin-extensions:1.2.0-M3"
    }

With Maven from Maven Central repositories (stable releases):

<dependency>
    <groupId>io.projectreactor.kotlin</groupId>
    <artifactId>reactor-kotlin-extensions</artifactId>
    <version>1.1.6</version>
</dependency>

Or from repo.spring.io with access to SNAPSHOT:

...
<dependencies>

    <dependency>
        <groupId>io.projectreactor.kotlin</groupId>
        <artifactId>reactor-kotlin-extensions</artifactId>
        <version>1.2.0-M3</version>
    </dependency>

</dependencies>
...
<repositories>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
    </repository>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

Quick Examples

Tuple destructure:

val (t1, t2, t3) = Tuples.of(O1, O2, O3)
assertEquals(t1, O1)
assertEquals(t2, O2)
assertEquals(t3, O3)

Convert, sum (requires reactor-extra) and test (requires reactor-test):

intArrayOf(2_000_000_000, 200_000_000) //sum overflows an Int
    .toFlux()
    .sum()
    .test()
    .expectNext(2_200_000_000)
    .verifyComplete()

Coordinating when two mono completes:

whenComplete("foo1".toMono(), "foo2".toMono())
    .test()
    .verifyComplete()

License

Reactor is Apache 2.0 licensed.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap