All Projects → jjeffcaii → reactor-go

jjeffcaii / reactor-go

Licence: MIT License
A golang implementation for reactive-streams.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to reactor-go

Spring Reactive Sample
Spring 5 Reactive playground
Stars: ✭ 867 (+1706.25%)
Mutual labels:  rxjava, reactive-streams, reactor
Rxjava2 Extras
Utilities for use with RxJava 2
Stars: ✭ 167 (+247.92%)
Mutual labels:  reactivex, rxjava, reactive-streams
Rhub
Reactive Event Hub
Stars: ✭ 66 (+37.5%)
Mutual labels:  rxjava, reactive-streams, reactor
Hivemq Mqtt Client
HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
Stars: ✭ 402 (+737.5%)
Mutual labels:  rxjava, reactive-streams, reactor
Reactive
Reactive: Examples of the most famous reactive libraries that you can find in the market.
Stars: ✭ 256 (+433.33%)
Mutual labels:  reactivex, rxjava, reactor
Awesome Reactive Programming
A repository for sharing all the resources available on Reactive Programming and Reactive Systems
Stars: ✭ 163 (+239.58%)
Mutual labels:  reactivex, reactive-streams
Rxkotlinfx
Kotlin extensions to the RxJavaFX framework
Stars: ✭ 177 (+268.75%)
Mutual labels:  reactivex, rxjava
reactive-streams-in-java
Code for "Reactive Streams in Java" book
Stars: ✭ 19 (-60.42%)
Mutual labels:  reactive-streams, reactor
sample-spring-webflux
testing webclient reactive communication with spring boot reactive application built on top of spring webflux
Stars: ✭ 21 (-56.25%)
Mutual labels:  reactive-streams, reactor
Rxkotlinfx Tornadofx Demo
A demo application demonstrating TornadoFX and Rx usage
Stars: ✭ 75 (+56.25%)
Mutual labels:  reactivex, rxjava
kotlin-kafka-and-kafka-streams-examples
Kafka with KafkaReactor and Kafka Streams Examples in Kotlin
Stars: ✭ 33 (-31.25%)
Mutual labels:  reactive-streams, reactor
KotlinReactiveMS
An educational project to learn reactive programming with Spring 5 and Kotlin
Stars: ✭ 33 (-31.25%)
Mutual labels:  reactive-streams, reactor
Monix
Asynchronous, Reactive Programming for Scala and Scala.js.
Stars: ✭ 1,819 (+3689.58%)
Mutual labels:  reactivex, reactive-streams
flutter-form-with-validation-BLOC
This form and validation functions are created by using the BLOC pattern with RxDart instead of using StatefulWidget
Stars: ✭ 63 (+31.25%)
Mutual labels:  reactivex, reactive-streams
Rxanimationbinding
RxJava binding APIs for Android's animations
Stars: ✭ 82 (+70.83%)
Mutual labels:  reactivex, rxjava
mongo-images
Ever wonder how you can create a full stack reactive application that also saves images? Well look no further! We've got Spring Webflux, Reactive Mongo Streams with GridFS, and Angular5!
Stars: ✭ 12 (-75%)
Mutual labels:  reactivex, reactive-streams
rxjava2-http
Transmit RxJava2 Flowable over http with non-blocking backpressure
Stars: ✭ 19 (-60.42%)
Mutual labels:  rxjava, reactive-streams
assembler
Functional, type-safe, stateless reactive Java API for efficient implementation of the API Composition Pattern for querying/merging data from multiple datasources/services, with a specific focus on solving the N + 1 query problem
Stars: ✭ 102 (+112.5%)
Mutual labels:  reactive-streams, reactor
servant
Serving you with GoogleApiClients any way you like them
Stars: ✭ 17 (-64.58%)
Mutual labels:  reactivex, rxjava
RxJava-Codelab
Codelab project for demonstration of RxJava features
Stars: ✭ 44 (-8.33%)
Mutual labels:  reactivex, rxjava

reactor-go 🚀🚀🚀

GitHub Workflow Status codecov GoDoc Go Report Card License GitHub Release

A golang implementation for reactive-streams.
🚧🚧🚧 IT IS UNDER ACTIVE DEVELOPMENT!!!
⚠️⚠️⚠️ DO NOT USE IN ANY PRODUCTION ENVIRONMENT!!!

Install

go get -u github.com/jjeffcaii/reactor-go

Example

NOTICE:
We can only use func(interface{})interface{} for most operations because Golang has not Generics. 😭
If you have any better idea, please let me know. 😀

Mono

package mono_test

import (
	"context"
	"fmt"

	"github.com/jjeffcaii/reactor-go"
	"github.com/jjeffcaii/reactor-go/mono"
)

func Example() {
	gen := func(ctx context.Context, sink mono.Sink) {
		sink.Success("World")
	}
	mono.
		Create(gen).
		Map(func(input reactor.Any) (output reactor.Any, err error) {
			output = "Hello " + input.(string) + "!"
			return
		}).
		DoOnNext(func(v reactor.Any) error {
			fmt.Println(v)
			return nil
		}).
		Subscribe(context.Background())
}

// Should print
// Hello World!

Flux

package flux_test

import (
	"context"
	"fmt"

	"github.com/jjeffcaii/reactor-go"
	"github.com/jjeffcaii/reactor-go/flux"
	"github.com/jjeffcaii/reactor-go/scheduler"
)

func Example() {
	gen := func(ctx context.Context, sink flux.Sink) {
		for i := 0; i < 10; i++ {
			v := i
			sink.Next(v)
		}
		sink.Complete()
	}
	done := make(chan struct{})

	var su reactor.Subscription
	flux.Create(gen).
		Filter(func(i interface{}) bool {
			return i.(int)%2 == 0
		}).
		Map(func(input reactor.Any) (output reactor.Any, err error) {
			output = fmt.Sprintf("#HELLO_%04d", input.(int))
			return
		}).
		SubscribeOn(scheduler.Elastic()).
		Subscribe(context.Background(),
			reactor.OnSubscribe(func(s reactor.Subscription) {
				su = s
				s.Request(1)
			}),
			reactor.OnNext(func(v reactor.Any) error {
				fmt.Println("next:", v)
				su.Request(1)
				return nil
			}),
			reactor.OnComplete(func() {
				close(done)
			}),
		)
	<-done
}
// Should print:
// next: #HELLO_0000
// next: #HELLO_0002
// next: #HELLO_0004
// next: #HELLO_0006
// next: #HELLO_0008
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].