• Stars
    star
    863
  • Rank 52,844 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Library to convert between RxJava 1.x and 2.x/3.x reactive types, schedulers and resource handles.

RxJavaInterop

codecov.io Maven Central

RxJava 1.x: RxJava 1.x RxJava 3.x: RxJava 3.x

Library to convert between RxJava 1.x and 3.x reactive types.

Interop between 2.x and 3.x

Check out the https://github.com/akarnokd/RxJavaBridge project.

Releases

gradle

dependencies {
    implementation "com.github.akarnokd:rxjava3-interop:3.0.2"
}

Maven search:

http://search.maven.org

Usage

Convert between the reactive base types

import hu.akarnokd.rxjava3.interop.RxJavaInterop;

// convert from 1.x to 3.x

io.reactivex.rxjava3.core.Flowable     f3  = RxJavaInterop.toV3Flowable(rx.Observable);

io.reactivex.rxjava3.core.Observable   o3  = RxJavaInterop.toV3Observable(rx.Observable);

io.reactivex.rxjava3.core.Single       s3  = RxJavaInterop.toV3Single(rx.Single);

io.reactivex.rxjava3.core.Completable  c3  = RxJavaInterop.toV3Completable(rx.Completable);

io.reactivex.rxjava3.core.Maybe        m3s = RxJavaInterop.toV3Maybe(rx.Single);

io.reactivex.rxjava3.core.Maybe        m3c = RxJavaInterop.toV3Maybe(rx.Completable);

// convert from 3.x to 1.x

rx.Observable  o1 = RxJavaInterop.toV1Observable(Publisher);

rx.Observable  q1 = RxJavaInterop.toV1Observable(ObservableSource, BackpressureStrategy);

rx.Single      s1 = RxJavaInterop.toV1Single(SingleSource);

rx.Completable c1 = RxJavaInterop.toV1Completable(CompletableSource);

rx.Single      s1m = RxJavaInterop.toV1Single(MaybeSource);

rx.Completable c1m = RxJavaInterop.toV1Completable(MaybeSource);

Convert between Subjects and Processors.

Note that 3.x Subjects and FlowableProcessors support only the same input and output types.

// convert from 1.x to 3.x

io.reactivex.rxjava3.subjects.Subject sj3 = RxJavaInterop.toV3Subject(rx.subjects.Subject);

io.reactivex.rxjava3.processors.FlowableProcessor fp3 = RxJavaInterop.toV3Processor(rx.subjects.Subject);

// convert from 3.x to 1.x

rx.subjects.Subject sj1 = RxJavaInterop.toV1Subject(io.reactivex.rxjava3.subjects.Subject);

rx.subjects.Subject sj1b = RxJavaInterop.toV1Subject(io.reactivex.rxjava3.processors.FlowableProcessor);

Convert between 1.x X.Transformers and 3.x XTransformers.

// convert from 1.x to 3.x

io.reactivex.rxjava3.core.FlowableTransformer    ft3 = RxJavaInterop.toV3Transformer(
                                                           rx.Observable.Transformer);

io.reactivex.rxjava3.core.ObservableTransformer  ot3 = RxJavaInterop.toV3Transformer(
                                                           rx.Observable.Transformer, 
                                                           io.reactivex.rxjava3.core.BackpressureStrategy);

io.reactivex.rxjava3.core.SingleTransformer      st3 = RxJavaInterop.toV3Transformer(
                                                           rx.Single.Transformer);

io.reactivex.rxjava3.core.CompletableTransformer ct3 = RxJavaInterop.toV3Transformer(
                                                           rx.Completable.Transformer);

// convert from 3.x to 1.x

rx.Observable.Transformer  ft1 = RxJavaInterop.toV1Transformer(
                                     io.reactivex.rxjava3.core.FlowableTransformer);

rx.Observable.Transformer  ot1 = RxJavaInterop.toV1Transformer(
                                     io.reactivex.rxjava3.core.ObservableTransformer,
                                     io.reactivex.rxjava3.core.BackpressureStrategy);

rx.Single.Transformer      st1 = RxJavaInterop.toV1Transformer(
                                     io.reactivex.rxjava3.core.SingleTransformer);

rx.Completable.Transformer ct1 = RxJavaInterop.toV1Transformer(
                                     io.reactivex.rxjava3.core.CompletableTransformer);

Convert between 1.x Flowable.Operator and 3.x FlowableOperator

// convert from 1.x to 3.x

io.reactivex.rxjava3.core.FlowableOperator fo3 = RxJavaInterop.toV3Operator(rx.Observable.Operator);

// convert from 3.x to 1.x

rx.Observable.Operator fo1 = RxJavaInterop.toV1Operator(io.reactivex.rxjava3.core.FlowableOperator);

Convert between 1.x Subscription and 3.x Disposable

// convert from 1.x to 3.x

io.reactivex.rxjava3.disposables.Disposable d3 = RxJavaInterop.toV3Disposable(rx.Subscription);

// convert from 3.x to 1.x

rx.Subscription s1 = RxJavaInterop.toV1Subscription(io.reactivex.rxjava3.disposables.Disposable);

Convert between 1.x Schedulers and 3.x Schedulers

// convert from 1.x to 3.x

io.reactivex.rxjava3.core.Scheduler s3 = RxJavaInterop.toV3Scheduler(rx.Scheduler);

// convert from 3.x to 1.x

rx.Scheduler s1 = RxJavaInterop.toV1Scheduler(io.reactivex.rxjava3.core.Scheduler);

More Repositories

1

RxJavaExtensions

RxJava 2.x & 3.x extra sources, operators and components and ports of many 1.x companion libraries.
Java
686
star
2

kotlin-flow-extensions

Extensions to the Kotlin Flow library.
Kotlin
504
star
3

open-ig

Free & open-source reimplementation of Imperium Galactica. Download the Installer below the file list!
Java
245
star
4

RxJava3-preview

Preview for version 3 of RxJava, the modern ReactiveX style library for composing (a)synchronous sequences of data and events
Java
234
star
5

ixjava

Iterable Extensions for Java 6+
Java
208
star
6

RxJavaRetrofitAdapter

RxJava 3 adapter for Retrofit 2
Java
124
star
7

RxJavaBridge

Bridge between RxJava 2 and RxJava 3
Java
94
star
8

RxJavaJdk8Interop

RxJava 2/3 interop library for supporting Java 8 features such as Optional, Stream and CompletableFuture [discontinued]
Java
71
star
9

jmh-compare-gui

GUI for comparing JMH results
Java
70
star
10

RxAgera

Convert between RxJava and Agera reactive base types
Java
60
star
11

akarnokd-misc

Miscellaneous classes, implementations with gradle and jmh set up
Java
54
star
12

reactive-extensions

Extensions to the dotnet/reactive library.
C#
50
star
13

Reactive4JavaFlow

Reactive Programming library based on the Java 9 Flow API and a 4th generation ReactiveX-style architecture.
Java
50
star
14

ThePlanetCrafterMods

BepInEx+Harmony mods for the Unity/Steam game The Planet Crafter
C#
45
star
15

async-enumerable-dotnet

Experimental operators for C# 8 IAsyncEnumerables
C#
39
star
16

Reactive4.NET

Modern, Reactive-Streams compliant library for composing (a)synchronous sequences of data and events
C#
35
star
17

RxJavaFiberInterop

Library for interoperation between RxJava 3 and JDK 21+ Virtual Threads
Java
33
star
18

plan-b-terraform-mods

Unity/BepInEx mods for the Steam game Plan B Terraform
C#
28
star
19

AgeraTest2

Small Android application to test reactive solutions
Java
21
star
20

RxJavaJdk9Interop

RxJava 2/3 interop library for supporting Java 9 features such as Flow.*
Java
21
star
21

async-enumerable

Prototype Java 9 library based on the asynchronous enumerable concept (where moveNext() returns a task to compose over).
Java
18
star
22

rng-76

Rng 76 - Hunt for the TSE
JavaScript
18
star
23

RxJavaSwing

Bridge between Java 6 Swing (GUI) events and RxJava 2/3 + a scheduler for the swing event dispatch thread.
Java
14
star
24

rxjava2-backport

Discontinued, use RxJava 2
Java
11
star
25

RxJavaAndroidInterop

Interop library for exposing Android's main thread and loopers as RxJava 3 Schedulers directly.
Java
11
star
26

akarnokd-reactive-rpc

Reactive Remote Procedure/Publisher Call/Consumption library based on Reactive-Streams
Java
11
star
27

RxAdvancedFlow

Fluent C# implementation of the ReactiveStreamsCS APIs.
C#
8
star
28

RxJavaCompletable

Completable class for valueless event composition with RxJava
Java
8
star
29

RxJavaFlow

RxJava reimplementation for Java 9 by using JDK's j.u.c.Flow API and functional classes
Java
7
star
30

surviving-mars-mods

Surviving Mars Mods
Lua
7
star
31

akarnokd-misc-kotlin

Miscellaneous code of me written in Kotlin.
Kotlin
6
star
32

akarnokd-tools-and-utils

My ad-hoc algorithms, programs and libraries
Java
6
star
33

RxJava2_9

RxJava 2 source code built with Java 8 through 14 environment for compatibility testing
Java
5
star
34

RxReactiveStreamsCSharp

C# port of the backpressure-aware, Reactive-Streams compliant RxJava 2.0 with fluent API
C#
4
star
35

phd_dissertation

My PhD dissertation and booklets
4
star
36

akarnokd-misc-java9

Misc code for Java 9
Java
3
star
37

loom-interop-experiments

Code to experiment with Project Loom continuation/fiber API.
Java
3
star
38

space-4x-management-game

Prototype 4x (explore, expand, exploit, exterminate) real-time space strategy game.
Java
3
star
39

RxTS

Reactive-Extensions over Reactive-Streams for TypeScript
TypeScript
3
star
40

reactive4java

Library for reactive, dataflow oriented programming for Java - the very first ReactiveX-style reactive programming library on the JVM from 2011-2012
Java
3
star
41

jdk-8-android-desugar-check

See how Android's desugaring would work with RxJava moved to Java 8
Java
3
star
42

jdk-9-experiments

Experiment with the new JDK 9 APIs
Java
2
star
43

ReactiveChannel

Exploring indeas around bidirectional reactive streams in memory and over a network boundary
Java
2
star
44

ReactiveStreamsCS

C# definition of the Reactive-Streams API plus Single and Completable.
C#
2
star
45

reactive-streams-impl

Non-fluent operators to interact with reactive-streams interfaces
Java
2
star
46

akarnokd-misc-scala

Scala experiments
Scala
2
star
47

RxJava3_BuildMatrix

Build RxJava 3 with multiple target Java and JVM versions
Java
2
star
48

RxJava2ReactorInterop

Native interoperation library between RxJava 2 and Reactor 3, including fusion, processors and schedulers
2
star
49

reactive-streams-jvm-extensions-xp

Experimental extensions to the Reactive-Streams API and TCKs: fusion, queues, standard tools.
Java
1
star
50

akarnokd-misc-swift

Swift experiments
Swift
1
star
51

RxJavaMicroprofileRS

RxJava 3 service implementation for the Eclipse Microprofile Reactive Streams Operators SPI
Java
1
star
52

akarnokd-opengl-experiment

My experimentation with LWJGL
Java
1
star
53

akarnokd-misc-dotnet

Various experiments with .NET code and libraries
C#
1
star
54

advance-flow-engine

Software of the EU project ADVANCE: Advanced predictive-analysis-based decision-support engine for logistics
Java
1
star