Top Description Inners Methods
io.reactivex.rxjava3.internal.schedulers

public Interface SchedulerMultiWorkerSupport

Known Direct Implementers
io.reactivex.rxjava3.internal.schedulers.ComputationScheduler, io.reactivex.rxjava3.internal.schedulers.ComputationScheduler.FixedSchedulerPool
Imports
io.reactivex.rxjava3.annotations.NonNull, io.reactivex.rxjava3.core.Scheduler

Allows retrieving multiple workers from the implementing io.reactivex.rxjava3.core.Scheduler in a way that when asking for at most the parallelism level of the Scheduler, those io.reactivex.rxjava3.core.Scheduler.Worker instances will be running with different backing threads.

History: 2.1.8 - experimental

Since
2.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Method Summary

Modifier and TypeMethod and Description
public void
createWorkers(int
the number of workers to create, positive
number
,
@NonNull SchedulerMultiWorkerSupport.WorkerCallback
the callback to send worker instances to
callback
)

Creates the given number of io.reactivex.rxjava3.core.Scheduler.Worker instances that are possibly backed by distinct threads and calls the specified Consumer with them.

Method Detail

createWorkersback to summary
public void createWorkers(int number, @NonNull SchedulerMultiWorkerSupport.WorkerCallback callback)

Creates the given number of io.reactivex.rxjava3.core.Scheduler.Worker instances that are possibly backed by distinct threads and calls the specified Consumer with them.

Parameters
number:int

the number of workers to create, positive

callback:@NonNull SchedulerMultiWorkerSupport.WorkerCallback

the callback to send worker instances to

io.reactivex.rxjava3.internal.schedulers back to summary

public Interface SchedulerMultiWorkerSupport.WorkerCallback

Known Direct Implementers
io.reactivex.rxjava3.internal.operators.parallel.ParallelRunOn.MultiWorkerCallback

The callback interface for the SchedulerMultiWorkerSupport#createWorkers(int, WorkerCallback) method.

Method Summary

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

Called with the Worker index and instance.

Method Detail

onWorkerback to summary
public void onWorker(int index, Scheduler.Worker worker)

Called with the Worker index and instance.

Parameters
index:int

the worker index, zero-based

worker:Scheduler.Worker

the worker instance