Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Warning to RxWorkers about Asynchrony #917

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ import org.reactivestreams.Publisher
* The [Observable] will be subscribed to when the [Worker] is started, and disposed when it is
* cancelled.
*
* Note that a [Worker] actually operates on a [kotlinx.coroutines.flow]. This means that your
* [Observable] will first be adapted to a flow. To do this a communication structure is used
* that will mean that the flow will process the items produced by the [Observable] asynchronously.
*
* Note that this [Observable] is transformed to a backpressure aware [Flowable] using the
* [BUFFER] strategy before being transformed to a flow, which means that buffering will happen
* in the [Flowable] before being passed over to the flow if it is experiencing backpressure.
*
* RxJava doesn't allow nulls, but it can't express that in its types. The receiver type parameter
* is nullable so that the resulting [Worker] is non-nullable instead of having
* platform nullability.
Expand All @@ -32,6 +40,10 @@ public inline fun <reified T : Any> Observable<out T?>.asWorker(): Worker<T> =
* The [Publisher] will be subscribed to when the [Worker] is started, and cancelled when it is
* cancelled.
*
* Note that a [Worker] actually operates on a [kotlinx.coroutines.flow]. This means that your
* [Publisher] will first be mapped to a flow. To do this a communication structure is used
* that will mean that the flow will process the items produced by the [Publisher] asynchronously.
*
* RxJava doesn't allow nulls, but it can't express that in its types. The receiver type parameter
* is nullable so that the resulting [Worker] is non-nullable instead of having
* platform nullability.
Expand Down