Top Description Inners Fields Constructors Methods
io.reactivex.rxjava3.internal.operators.parallel

public final Class ParallelRunOn<T>

extends ParallelFlowable<T>
Class Inheritance
Type Parameters
<T>
the value type
Imports
java.util.concurrent.atomic.*, org.reactivestreams.*, io.reactivex.rxjava3.core.*, .Scheduler.Worker, io.reactivex.rxjava3.exceptions.*, io.reactivex.rxjava3.internal.schedulers.SchedulerMultiWorkerSupport, .SchedulerMultiWorkerSupport.WorkerCallback, io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper, io.reactivex.rxjava3.internal.util.BackpressureHelper, io.reactivex.rxjava3.operators.ConditionalSubscriber, .SpscArrayQueue, io.reactivex.rxjava3.parallel.ParallelFlowable, io.reactivex.rxjava3.plugins.RxJavaPlugins

Ensures each 'rail' from upstream runs on a Worker from a Scheduler.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv abstract static class
pack-priv class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final Scheduler
pack-priv final ParallelFlowable<? extends T>

Constructor Summary

AccessConstructor and Description
public
ParallelRunOn(ParallelFlowable<? extends T> parent, Scheduler scheduler, int prefetch)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
createSubscriber(int i, Subscriber<? super T>[] subscribers, Subscriber<T>[] parents, Scheduler.Worker worker)

public int
parallelism()

Implements abstract io.reactivex.rxjava3.parallel.ParallelFlowable.parallelism.

Returns the number of expected parallel Subscribers.
public void
subscribe(Subscriber<? super T>[] subscribers)

Inherited from io.reactivex.rxjava3.parallel.ParallelFlowable:
collectcollectcomposeconcatMapconcatMapconcatMapDelayErrorconcatMapDelayErrordoAfterNextdoAfterTerminateddoOnCanceldoOnCompletedoOnErrordoOnNextdoOnNextdoOnNextdoOnRequestdoOnSubscribefilterfilterfilterflatMapflatMapflatMapflatMapflatMapIterableflatMapIterableflatMapStreamflatMapStreamfromfromfromfromArraymapmapmapmapOptionalmapOptionalmapOptionalreducereducerunOnrunOnsequentialsequentialsequentialDelayErrorsequentialDelayErrorsortedsortedsubscribetotoSortedListtoSortedListvalidate

Field Detail

prefetchback to summary
pack-priv final int prefetch
schedulerback to summary
pack-priv final Scheduler scheduler
sourceback to summary
pack-priv final ParallelFlowable<? extends T> source

Constructor Detail

ParallelRunOnback to summary
public ParallelRunOn(ParallelFlowable<? extends T> parent, Scheduler scheduler, int prefetch)

Method Detail

createSubscriberback to summary
pack-priv void createSubscriber(int i, Subscriber<? super T>[] subscribers, Subscriber<T>[] parents, Scheduler.Worker worker)
parallelismback to summary
public int parallelism()

Implements abstract io.reactivex.rxjava3.parallel.ParallelFlowable.parallelism.

Doc from io.reactivex.rxjava3.parallel.ParallelFlowable.parallelism.

Returns the number of expected parallel Subscribers.

Returns:int

the number of expected parallel Subscribers

Annotations
@Override
subscribeback to summary
public void subscribe(Subscriber<? super T>[] subscribers)
Annotations
@Override
io.reactivex.rxjava3.internal.operators.parallel back to summary

pack-priv abstract Class ParallelRunOn.BaseRunOnSubscriber<T>

extends AtomicInteger
implements FlowableSubscriber<T>, Subscription, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, org.reactivestreams.Subscription, io.reactivex.rxjava3.core.FlowableSubscriber, org.reactivestreams.Subscriber
Known Direct Subclasses
io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.RunOnSubscriber, io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.RunOnConditionalSubscriber

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean
pack-priv int
pack-priv volatile boolean
pack-priv Throwable
pack-priv final int
pack-priv final int
pack-priv final SpscArrayQueue<T>
pack-priv final AtomicLong
private static final long
pack-priv Subscription
pack-priv final Scheduler.Worker

Constructor Summary

AccessConstructor and Description
pack-priv
BaseRunOnSubscriber(int prefetch, SpscArrayQueue<T> queue, Scheduler.Worker worker)

Method Summary

Modifier and TypeMethod and Description
public final void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
public final void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public final void
onError(Throwable
the throwable signaled
t
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
public final void
onNext(T
the element signaled
t
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
public final void
request(long
the strictly positive number of elements to requests to the upstream Publisher
n
)

Implements org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.
pack-priv final void
Inherited from java.util.concurrent.atomic.AtomicInteger:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

cancelledback to summary
pack-priv volatile boolean cancelled
consumedback to summary
pack-priv int consumed
doneback to summary
pack-priv volatile boolean done
errorback to summary
pack-priv Throwable error
limitback to summary
pack-priv final int limit
prefetchback to summary
pack-priv final int prefetch
queueback to summary
pack-priv final SpscArrayQueue<T> queue
requestedback to summary
pack-priv final AtomicLong requested
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicInteger.serialVersionUID.

upstreamback to summary
pack-priv Subscription upstream
workerback to summary
pack-priv final Scheduler.Worker worker

Constructor Detail

BaseRunOnSubscriberback to summary
pack-priv BaseRunOnSubscriber(int prefetch, SpscArrayQueue<T> queue, Scheduler.Worker worker)

Method Detail

cancelback to summary
public final void cancel()

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
onCompleteback to summary
public final void onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Doc from org.reactivestreams.Subscriber.onComplete.

Successful terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Annotations
@Override
onErrorback to summary
public final void onError(Throwable t)

Implements org.reactivestreams.Subscriber.onError.

Doc from org.reactivestreams.Subscriber.onError.

Failed terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Parameters
t:Throwable

the throwable signaled

Annotations
@Override
onNextback to summary
public final void onNext(T t)

Implements org.reactivestreams.Subscriber.onNext.

Doc from org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).

Parameters
t:T

the element signaled

Annotations
@Override
requestback to summary
public final void request(long n)

Implements org.reactivestreams.Subscription.request.

Doc from org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.

It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the Publisher as "effectively unbounded".

Whatever has been requested can be sent by the Publisher so only signal demand for what can be safely handled.

A Publisher can send less than is requested if the stream ends but then must emit either Subscriber#onError(Throwable) or Subscriber#onComplete().

Parameters
n:long

the strictly positive number of elements to requests to the upstream Publisher

Annotations
@Override
scheduleback to summary
pack-priv final void schedule()
io.reactivex.rxjava3.internal.operators.parallel back to summary

pack-priv final Class ParallelRunOn.MultiWorkerCallback

extends Object
implements WorkerCallback
Class Inheritance
  • java.lang.Object
  • io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.MultiWorkerCallback
All Implemented Interfaces
io.reactivex.rxjava3.internal.schedulers.SchedulerMultiWorkerSupport.WorkerCallback

Field Summary

Modifier and TypeField and Description
pack-priv final Subscriber<T>[]
pack-priv final Subscriber<? super T>[]

Constructor Summary

AccessConstructor and Description
pack-priv
MultiWorkerCallback(Subscriber<? super T>[] subscribers, Subscriber<T>[] parents)

Method Summary

Modifier and TypeMethod and Description
public void
onWorker(int
the worker index, zero-based
i
,
Scheduler.Worker
the worker instance
w
)

Implements io.reactivex.rxjava3.internal.schedulers.SchedulerMultiWorkerSupport.WorkerCallback.onWorker.

Called with the Worker index and instance.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parentsback to summary
pack-priv final Subscriber<T>[] parents
subscribersback to summary
pack-priv final Subscriber<? super T>[] subscribers

Constructor Detail

MultiWorkerCallbackback to summary
pack-priv MultiWorkerCallback(Subscriber<? super T>[] subscribers, Subscriber<T>[] parents)

Method Detail

onWorkerback to summary
public void onWorker(int i, Scheduler.Worker w)

Implements io.reactivex.rxjava3.internal.schedulers.SchedulerMultiWorkerSupport.WorkerCallback.onWorker.

Doc from io.reactivex.rxjava3.internal.schedulers.SchedulerMultiWorkerSupport.WorkerCallback.onWorker.

Called with the Worker index and instance.

Parameters
i:int

the worker index, zero-based

w:Scheduler.Worker

the worker instance

Annotations
@Override
io.reactivex.rxjava3.internal.operators.parallel back to summary

pack-priv final Class ParallelRunOn.RunOnConditionalSubscriber<T>

extends ParallelRunOn.BaseRunOnSubscriber<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final ConditionalSubscriber<? super T>
private static final long
Inherited from io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.BaseRunOnSubscriber:
cancelledconsumeddoneerrorlimitprefetchqueuerequestedupstreamworker

Constructor Summary

AccessConstructor and Description
pack-priv
RunOnConditionalSubscriber(ConditionalSubscriber<? super T> actual, int prefetch, SpscArrayQueue<T> queue, Scheduler.Worker worker)

Method Summary

Modifier and TypeMethod and Description
public void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.BaseRunOnSubscriber:
cancelonCompleteonErroronNextrequestschedule

Field Detail

downstreamback to summary
pack-priv final ConditionalSubscriber<? super T> downstream
serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.BaseRunOnSubscriber.serialVersionUID.

Constructor Detail

RunOnConditionalSubscriberback to summary
pack-priv RunOnConditionalSubscriber(ConditionalSubscriber<? super T> actual, int prefetch, SpscArrayQueue<T> queue, Scheduler.Worker worker)

Method Detail

onSubscribeback to summary
public void onSubscribe(Subscription s)

Implements org.reactivestreams.Subscriber.onSubscribe.

Doc from org.reactivestreams.Subscriber.onSubscribe.

Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
s:Subscription

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
io.reactivex.rxjava3.internal.operators.parallel back to summary

pack-priv final Class ParallelRunOn.RunOnSubscriber<T>

extends ParallelRunOn.BaseRunOnSubscriber<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final Subscriber<? super T>
private static final long
Inherited from io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.BaseRunOnSubscriber:
cancelledconsumeddoneerrorlimitprefetchqueuerequestedupstreamworker

Constructor Summary

AccessConstructor and Description
pack-priv
RunOnSubscriber(Subscriber<? super T> actual, int prefetch, SpscArrayQueue<T> queue, Scheduler.Worker worker)

Method Summary

Modifier and TypeMethod and Description
public void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.BaseRunOnSubscriber:
cancelonCompleteonErroronNextrequestschedule

Field Detail

downstreamback to summary
pack-priv final Subscriber<? super T> downstream
serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.BaseRunOnSubscriber.serialVersionUID.

Constructor Detail

RunOnSubscriberback to summary
pack-priv RunOnSubscriber(Subscriber<? super T> actual, int prefetch, SpscArrayQueue<T> queue, Scheduler.Worker worker)

Method Detail

onSubscribeback to summary
public void onSubscribe(Subscription s)

Implements org.reactivestreams.Subscriber.onSubscribe.

Doc from org.reactivestreams.Subscriber.onSubscribe.

Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
s:Subscription

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override