- Companion:
- class
Type members
Classlikes
Utilities complementing the Scheduler
interface.
Utilities complementing the Scheduler
interface.
Inherited classlikes
Value members
Inherited methods
Scheduler builder - uses monix's
default ScheduledExecutorService
for handling the scheduling of tasks.
Uses Scala's s.c.ExecutionContext.global
for actual execution.
Scheduler builder - uses monix's
default ScheduledExecutorService
for handling the scheduling of tasks.
Uses Scala's s.c.ExecutionContext.global
for actual execution.
- Value parameters:
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder - uses monix's
default ScheduledExecutorService
for handling the scheduling of tasks.
Uses Scala's s.c.ExecutionContext.global
for actual execution.
Scheduler builder - uses monix's
default ScheduledExecutorService
for handling the scheduling of tasks.
Uses Scala's s.c.ExecutionContext.global
for actual execution.
- Value parameters:
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder - uses monix's
default ScheduledExecutorService
for handling the scheduling of tasks.
Scheduler builder - uses monix's
default ScheduledExecutorService
for handling the scheduling of tasks.
- Value parameters:
- ec
is the execution context on top of which all tasks will run.
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder - uses monix's
default ScheduledExecutorService
for handling the scheduling of tasks.
Scheduler builder - uses monix's
default ScheduledExecutorService
for handling the scheduling of tasks.
- Value parameters:
- ec
is the execution context on top of which all tasks will run.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder that converts a
Java ExecutorService
into a scheduler.
Scheduler builder that converts a
Java ExecutorService
into a scheduler.
- Value parameters:
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- executor
is the
ScheduledExecutorService
that handles the scheduling of tasks into the future. If not provided, an internal default will be used. You can also create one withjava.util.concurrent.Executors
.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder that converts a
Java ExecutorService
into a scheduler.
Scheduler builder that converts a
Java ExecutorService
into a scheduler.
- Value parameters:
- executor
is the
ScheduledExecutorService
that handles the scheduling of tasks into the future. If not provided, an internal default will be used. You can also create one withjava.util.concurrent.Executors
.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder that converts a
Java ExecutorService
into a scheduler.
Scheduler builder that converts a
Java ExecutorService
into a scheduler.
- Value parameters:
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- executor
is the
ScheduledExecutorService
that handles the scheduling of tasks into the future. If not provided, an internal default will be used. You can also create one withjava.util.concurrent.Executors
.- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder that converts a
Java ExecutorService
into a scheduler.
Scheduler builder that converts a
Java ExecutorService
into a scheduler.
- Value parameters:
- executor
is the
ScheduledExecutorService
that handles the scheduling of tasks into the future. If not provided, an internal default will be used. You can also create one withjava.util.concurrent.Executors
.- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder .
Scheduler builder .
- Value parameters:
- ec
is the execution context on top of which all tasks will run. Use
scala.concurrent.ExecutionContext.Implicits.global
for the default.- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder.
Scheduler builder.
- Value parameters:
- ec
is the execution context on top of which all tasks will run. Use
scala.concurrent.ExecutionContext.Implicits.global
for the default.- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder.
Scheduler builder.
- Value parameters:
- ec
is the execution context on top of which all tasks will run. Use
scala.concurrent.ExecutionContext.Implicits.global
for the default.- executor
is the
ScheduledExecutorService
that handles the scheduling of tasks into the future. If not provided, an internal default will be used. You can also create one withjava.util.concurrent.Executors
.
- Inherited from:
- SchedulerCompanionImpl
Scheduler builder.
Scheduler builder.
The resulting Scheduler will piggyback on top of a Java
ScheduledExecutorService
for scheduling tasks for execution with
a delay and a Scala ExecutionContext
for actually executing the
tasks.
- Value parameters:
- ec
is the execution context on top of which all tasks will run. Use
scala.concurrent.ExecutionContext.Implicits.global
for the default.- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- executor
is the
ScheduledExecutorService
that handles the scheduling of tasks into the future. If not provided, an internal default will be used. You can also create one withjava.util.concurrent.Executors
.- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Builds a Scheduler backed by an internal
java.util.concurrent.ThreadPoolExecutor
, that executes each submitted
task using one of possibly several pooled threads.
Builds a Scheduler backed by an internal
java.util.concurrent.ThreadPoolExecutor
, that executes each submitted
task using one of possibly several pooled threads.
- Value parameters:
- daemonic
specifies whether the created threads should be daemonic (non-daemonic threads are blocking the JVM process on exit).
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- keepAliveTime
when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating
- maxThreads
the maximum number of threads to allow in the pool
- minThreads
the number of threads to keep in the pool, even if they are idle
- name
the created threads name prefix, for easy identification
- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Creates a Scheduler meant for computationally heavy CPU-bound tasks.
Creates a Scheduler meant for computationally heavy CPU-bound tasks.
Characteristics:
- backed by a
ForkJoinPool
implementation, in async mode - uses monix's default
ScheduledExecutorService
instance for scheduling - DOES NOT cooperate with Scala's
BlockContext
- Value parameters:
- daemonic
specifies whether the created threads should be daemonic (non-daemonic threads are blocking the JVM process on exit).
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- name
the created threads name prefix, for easy identification.
- parallelism
is the number of threads that can run in parallel
- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Builds a Scheduler with a fixed thread-pool.
Builds a Scheduler with a fixed thread-pool.
Characteristics:
- backed by a fixed pool
ScheduledExecutorService
that takes care of both scheduling tasks in the future and of executing immediate tasks - does not cooperate with Scala's
BlockingContext
, so tasks should not block on the result of other tasks scheduled to run on this same thread
- Value parameters:
- daemonic
specifies whether the created thread should be daemonic
- name
the created threads name prefix, for easy identification.
- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions.
- Inherited from:
- SchedulerCompanionImpl
Creates a general purpose Scheduler
backed by a ForkJoinPool
, similar to Scala's global
.
Creates a general purpose Scheduler
backed by a ForkJoinPool
, similar to Scala's global
.
Characteristics:
- backed by a
ForkJoinPool
implementation, in async mode - uses monix's default
ScheduledExecutorService
instance for scheduling - cooperates with Scala's
BlockContext
- Value parameters:
- daemonic
specifies whether the created threads should be daemonic (non-daemonic threads are blocking the JVM process on exit).
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- maxThreads
is the maximum number of threads that can be created
- name
the created threads name prefix, for easy identification.
- parallelism
is the number of threads that can run in parallel
- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
The explicit global Scheduler
. Invoke global
when you want
to provide the global Scheduler
explicitly.
The explicit global Scheduler
. Invoke global
when you want
to provide the global Scheduler
explicitly.
The default Scheduler
implementation is backed by a
work-stealing thread pool, along with a single-threaded
ScheduledExecutionContext
that does the scheduling. By default,
the thread pool uses a target number of worker threads equal
to the number of
available processors.
- Returns:
the global
Scheduler
- Inherited from:
- SchedulerCompanionImpl
Creates a Scheduler meant for blocking I/O tasks.
Creates a Scheduler meant for blocking I/O tasks.
Characteristics:
- backed by a cached
ThreadPool
executor with 60 seconds of keep-alive - the maximum number of threads is unbounded, as recommended for blocking I/O
- uses monix's default
ScheduledExecutorService
instance for scheduling - doesn't cooperate with Scala's
BlockContext
because it is unbounded
- Value parameters:
- daemonic
specifies whether the created threads should be daemonic (non-daemonic threads are blocking the JVM process on exit).
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- name
the created threads name prefix, for easy identification.
- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
Builds a Scheduler that schedules and executes tasks on its own thread.
Builds a Scheduler that schedules and executes tasks on its own thread.
Characteristics:
- backed by a single-threaded
ScheduledExecutorService
that takes care of both scheduling tasks in the future and of executing tasks - does not cooperate with Scala's
BlockingContext
, so tasks should not block on the result of other tasks scheduled to run on this same thread
- Value parameters:
- daemonic
specifies whether the created thread should be daemonic (non-daemonic threads are blocking the JVM process on exit)
- executionModel
is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- name
is the name of the created thread, for easy identification
- reporter
is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailure
or use UncaughtExceptionReporter.default for the default.
- Inherited from:
- SchedulerCompanionImpl
A global Scheduler instance that does propagation of Local.Context on async execution.
A global Scheduler instance that does propagation of Local.Context on async execution.
It wraps global.
- Inherited from:
- SchedulerCompanionImpl
Builds a TrampolineScheduler.
Builds a TrampolineScheduler.
- Value parameters:
- underlying
is the Scheduler to which the we defer to in case asynchronous or time-delayed execution is needed
- Inherited from:
- SchedulerCompanionImpl
Concrete fields
The Scheduler supports processing in batches via an internal trampoline.
The Scheduler supports processing in batches via an internal trampoline.
Schedulers that implement the batching behavior will recognize
monix.execution.schedulers.TrampolinedRunnable instances
(via instanceOf
checks) and make an effort to execute them on
the current thread.
This flag is exposed via Scheduler.features.
- See also:
BatchingScheduler for an implementation.
Flag signaling that the Scheduler implementation can transport Local variables over async boundaries.
Flag signaling that the Scheduler implementation can transport Local variables over async boundaries.
- See also:
TracingScheduler and TracingSchedulerService for implementations.
Inherited fields
The default ScheduledExecutor
instance.
The default ScheduledExecutor
instance.
Currently it's a single-threaded Java ScheduledExecutorService
used for scheduling delayed tasks for execution. But the actual
execution will not happen on this executor service. In general
you can just reuse this one for all your scheduling needs.
- Inherited from:
- SchedulerCompanionImpl