Skip to content

karolkrasnowski/reactor-kotlin-extensions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 {
      //compile "io.projectreactor.kotlin:reactor-kotlin-extensions:1.1.1-SNAPSHOT"
      compile "io.projectreactor.kotlin:reactor-kotlin-extensions:1.1.0"
    }

With Maven from Maven Central repositories (stable releases):

<dependency>
    <groupId>io.projectreactor.kotlin</groupId>
    <artifactId>reactor-kotlin-extensions</artifactId>
    <version>1.1.0</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.1.1-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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 98.5%
  • Java 1.5%