Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

reactor/reactor-kotlin-extensions

Open more actions menu

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:

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

    dependencies {
        //implementation "io.projectreactor.kotlin:reactor-kotlin-extensions:1.3.0-SNAPSHOT"
        implementation "io.projectreactor.kotlin:reactor-kotlin-extensions:1.3.0-RC5"
    }

With Maven from Maven Central repositories (stable releases):

<dependency>
    <groupId>io.projectreactor.kotlin</groupId>
    <artifactId>reactor-kotlin-extensions</artifactId>
    <version>1.3.0-RC5</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.3.0-SNAPSHOT</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.

About

Reactor Kotlin Support

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 21

Morty Proxy This is a proxified and sanitized view of the page, visit original site.