Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

akarnokd/RxJavaInterop

Repository files navigation

codecov.ioMaven Central

RxJava 1.x:RxJava 1.xRxJava 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 thehttps://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

importhu.akarnokd.rxjava3.interop.RxJavaInterop;// convert from 1.x to 3.xio.reactivex.rxjava3.core.Flowablef3  =RxJavaInterop.toV3Flowable(rx.Observable);io.reactivex.rxjava3.core.Observableo3  =RxJavaInterop.toV3Observable(rx.Observable);io.reactivex.rxjava3.core.Singles3  =RxJavaInterop.toV3Single(rx.Single);io.reactivex.rxjava3.core.Completablec3  =RxJavaInterop.toV3Completable(rx.Completable);io.reactivex.rxjava3.core.Maybem3s =RxJavaInterop.toV3Maybe(rx.Single);io.reactivex.rxjava3.core.Maybem3c =RxJavaInterop.toV3Maybe(rx.Completable);// convert from 3.x to 1.xrx.Observableo1 =RxJavaInterop.toV1Observable(Publisher);rx.Observableq1 =RxJavaInterop.toV1Observable(ObservableSource,BackpressureStrategy);rx.Singles1 =RxJavaInterop.toV1Single(SingleSource);rx.Completablec1 =RxJavaInterop.toV1Completable(CompletableSource);rx.Singles1m =RxJavaInterop.toV1Single(MaybeSource);rx.Completablec1m =RxJavaInterop.toV1Completable(MaybeSource);

Convert between Subjects and Processors.

Note that 3.xSubjects andFlowableProcessors support only the same input and output types.

// convert from 1.x to 3.xio.reactivex.rxjava3.subjects.Subjectsj3 =RxJavaInterop.toV3Subject(rx.subjects.Subject);io.reactivex.rxjava3.processors.FlowableProcessorfp3 =RxJavaInterop.toV3Processor(rx.subjects.Subject);// convert from 3.x to 1.xrx.subjects.Subjectsj1 =RxJavaInterop.toV1Subject(io.reactivex.rxjava3.subjects.Subject);rx.subjects.Subjectsj1b =RxJavaInterop.toV1Subject(io.reactivex.rxjava3.processors.FlowableProcessor);

Convert between 1.xX.Transformers and 3.xXTransformers.

// convert from 1.x to 3.xio.reactivex.rxjava3.core.FlowableTransformerft3 =RxJavaInterop.toV3Transformer(rx.Observable.Transformer);io.reactivex.rxjava3.core.ObservableTransformerot3 =RxJavaInterop.toV3Transformer(rx.Observable.Transformer,io.reactivex.rxjava3.core.BackpressureStrategy);io.reactivex.rxjava3.core.SingleTransformerst3 =RxJavaInterop.toV3Transformer(rx.Single.Transformer);io.reactivex.rxjava3.core.CompletableTransformerct3 =RxJavaInterop.toV3Transformer(rx.Completable.Transformer);// convert from 3.x to 1.xrx.Observable.Transformerft1 =RxJavaInterop.toV1Transformer(io.reactivex.rxjava3.core.FlowableTransformer);rx.Observable.Transformerot1 =RxJavaInterop.toV1Transformer(io.reactivex.rxjava3.core.ObservableTransformer,io.reactivex.rxjava3.core.BackpressureStrategy);rx.Single.Transformerst1 =RxJavaInterop.toV1Transformer(io.reactivex.rxjava3.core.SingleTransformer);rx.Completable.Transformerct1 =RxJavaInterop.toV1Transformer(io.reactivex.rxjava3.core.CompletableTransformer);

Convert between 1.xFlowable.Operator and 3.xFlowableOperator

// convert from 1.x to 3.xio.reactivex.rxjava3.core.FlowableOperatorfo3 =RxJavaInterop.toV3Operator(rx.Observable.Operator);// convert from 3.x to 1.xrx.Observable.Operatorfo1 =RxJavaInterop.toV1Operator(io.reactivex.rxjava3.core.FlowableOperator);

Convert between 1.xSubscription and 3.xDisposable

// convert from 1.x to 3.xio.reactivex.rxjava3.disposables.Disposabled3 =RxJavaInterop.toV3Disposable(rx.Subscription);// convert from 3.x to 1.xrx.Subscriptions1 =RxJavaInterop.toV1Subscription(io.reactivex.rxjava3.disposables.Disposable);

Convert between 1.xSchedulers and 3.xSchedulers

// convert from 1.x to 3.xio.reactivex.rxjava3.core.Schedulers3 =RxJavaInterop.toV3Scheduler(rx.Scheduler);// convert from 3.x to 1.xrx.Schedulers1 =RxJavaInterop.toV1Scheduler(io.reactivex.rxjava3.core.Scheduler);

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp