AutoDispose

class AutoDispose

Factories for autodispose converters that can be used with RxJava types' corresponding {@code * as(...)} methods to transform them into auto-disposing streams.

There are several static {@code autoDisposable(...)} entry points, with the most basic being a simple autoDisposable. The provided CompletableSource is ultimately what every scope resolves to under the hood, and AutoDispose has some built-in understanding for predefined types. The scope is considered ended upon onComplete emission of this Completable.

This is structured in such a way to be friendly to autocompletion in IDEs, where the no-parameter generic method will autocomplete with the appropriate generic parameters in Java <7, or implicitly in >=8.

See also

io.reactivex.rxjava3.core.Flowable

Flowable#to(io.reactivex.rxjava3.core.FlowableConverter)

io.reactivex.rxjava3.core.Observable

Observable#to(io.reactivex.rxjava3.core.ObservableConverter)

io.reactivex.rxjava3.core.Maybe

Maybe#to(io.reactivex.rxjava3.core.MaybeConverter)

io.reactivex.rxjava3.core.Single

Single#to(io.reactivex.rxjava3.core.SingleConverter)

io.reactivex.rxjava3.core.Completable

Completable#to(io.reactivex.rxjava3.core.CompletableConverter)

Functions

autoDisposable
Link copied to clipboard
open fun <@NonNull() T> autoDisposable(provider: ScopeProvider): AutoDisposeConverter<T>
Entry point for auto-disposing streams from a ScopeProvider.
open fun <@NonNull() T> autoDisposable(scope: CompletableSource): AutoDisposeConverter<T>
Entry point for auto-disposing streams from a CompletableSource.