Package autodispose2
AutoDispose is an RxJava 2 tool for automatically binding the execution of RxJava 2 streams to a provided scope via disposal/cancellation.
The idea is simple: construct your chain like any other, and then at subscription you simply drop in the relevant factory call + method for that type as a converter. In everyday use, it usually looks like this:
myObservable .doStuff() .to(autoDisposable(this)) // <-- AutoDispose .subscribe(s -> ...);
By doing this, you will automatically unsubscribe from myObservable as indicated by your scope - this helps prevent many classes of errors when an observable emits and item, but the actions taken in the subscription are no longer valid. For instance, if a network request comes back after a UI has already been torn down, the UI can't be updated - this pattern prevents this type of bug.
Types
AutoDispose
Link copied to clipboard
class AutoDispose
Content copied to clipboard
AutoDisposeContext
Link copied to clipboard
interface AutoDisposeContext
Content copied to clipboard
A context intended for use as
AutoDisposeContext.() -> Unit function body parameters where zero-arg autoDispose functions can be called.AutoDisposeConverter
Link copied to clipboard
interface AutoDisposeConverter<@NonNull() T> : FlowableConverter<T, FlowableSubscribeProxy<T>> , ParallelFlowableConverter<T, ParallelFlowableSubscribeProxy<T>> , ObservableConverter<T, ObservableSubscribeProxy<T>> , MaybeConverter<T, MaybeSubscribeProxy<T>> , SingleConverter<T, SingleSubscribeProxy<T>> , CompletableConverter<CompletableSubscribeProxy>
Content copied to clipboard
AutoDisposePlugins
Link copied to clipboard
class AutoDisposePlugins
Content copied to clipboard
CompletableSubscribeProxy
Link copied to clipboard
interface CompletableSubscribeProxy
Content copied to clipboard
FlowableSubscribeProxy
Link copied to clipboard
MaybeSubscribeProxy
Link copied to clipboard
ObservableSubscribeProxy
Link copied to clipboard
OutsideScopeException
Link copied to clipboard
ParallelFlowableSubscribeProxy
Link copied to clipboard
ScopeProvider
Link copied to clipboard
SingleSubscribeProxy
Link copied to clipboard
TestScopeProvider
Link copied to clipboard
Functions
autoDispose
Link copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
@CheckReturnValue()
Content copied to clipboard
withScope
Link copied to clipboard
inline fun withScope(scope: ScopeProvider, body: AutoDisposeContext.() -> Unit)
Content copied to clipboard
inline fun withScope(completableScope: Completable, body: AutoDisposeContext.() -> Unit)
Content copied to clipboard