resolveScopeFromLifecycle

Overload for resolving lifecycle providers that defaults to checking start and end boundaries of lifecycles. That is, they will ensure that the lifecycle has both started and not ended.

Note: This resolves the scope immediately, so consider deferring execution as needed, such as using defer.

Return

a resolved CompletableSource representation of a given provider

Parameters

provider

the LifecycleScopeProvider to resolve.

<E>

the lifecycle event type

Throws


Overload for resolving lifecycle providers allows configuration of checking "end" boundaries of lifecycles. That is, they will ensure that the lifecycle has both started and not ended, and otherwise will throw one of LifecycleNotStartedException (if peekLifecycle returns null) or if the lifecycle is ended. To configure the runtime behavior of these exceptions, see AutoDisposePlugins.

Note: This resolves the scope immediately, so consider deferring execution as needed, such as using defer.

Return

a resolved CompletableSource representation of a given provider

Parameters

provider

the LifecycleScopeProvider to resolve.

checkEndBoundary

whether or not to check that the lifecycle has ended

<E>

the lifecycle event type

Throws


open fun <@NonNull E> resolveScopeFromLifecycle(lifecycle: Observable<E>, endEvent: E): CompletableSource

Returns a resolved Completable representation of a given lifecycle, targeting the given event

Parameters

lifecycle

the stream of lifecycle events

endEvent

the target end event

<E>

the lifecycle event type


open fun <@NonNull E> resolveScopeFromLifecycle(lifecycle: Observable<E>, endEvent: E, @Nullable comparator: @Nullable Comparator<E>): CompletableSource

Returns a resolved Completable representation of a given lifecycle, targeting the given event

Parameters

lifecycle

the stream of lifecycle events

endEvent

the target end event

comparator

an optional comparator for checking event equality.

<E>

the lifecycle event type