Packages

p

monix.execution

schedulers

package schedulers

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. schedulers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class AsyncScheduler extends ReferenceScheduler with BatchingScheduler

    An AsyncScheduler schedules tasks to happen in the future with the given ScheduledExecutorService and the tasks themselves are executed on the given ExecutionContext.

  2. trait BatchingScheduler extends Scheduler

    Adds trampoline execution capabilities to schedulers, when inherited.

    Adds trampoline execution capabilities to schedulers, when inherited.

    When it receives TrampolinedRunnable instances, it switches to a trampolined mode where all incoming TrampolinedRunnable are executed on the current thread.

    This is useful for light-weight callbacks. The idea is borrowed from the implementation of scala.concurrent.Future. Currently used as an optimization by Task in processing its internal callbacks.

  3. sealed abstract class ExecutionModel extends Product with Serializable

    Specification for run-loops, imposed by the Scheduler.

    Specification for run-loops, imposed by the Scheduler.

    When executing tasks, a run-loop can always execute tasks asynchronously (by forking logical threads), or it can always execute them synchronously (same thread and call-stack, by using an internal trampoline), or it can do a mixed mode that executes tasks in batches before forking.

    The specification is considered a recommendation for how run loops should behave, but ultimately it's up to the client to choose the best execution model. This can be related to recursive loops or to events pushed into consumers.

  4. final class ExecutorScheduler extends ReferenceScheduler with BatchingScheduler

    An ExecutorScheduler is for building a Scheduler out of a ScheduledExecutorService.

  5. trait ReferenceScheduler extends Scheduler

    Helper for building a Scheduler.

    Helper for building a Scheduler.

    You can inherit from this class and provided a correct scheduleOnce you'll get Scheduler.scheduleWithFixedDelay and Scheduler.scheduleAtFixedRate for free.

  6. final case class StartAsyncBatchRunnable (start: TrampolinedRunnable, s: Scheduler) extends Runnable with Serializable with Product

    Forces a real asynchronous boundary before executing the given TrampolinedRunnable.

    Forces a real asynchronous boundary before executing the given TrampolinedRunnable.

    Sometimes you want to execute multiple TrampolinedRunnable instances as a batch, with the functionality provided by schedulers implementing BatchingScheduler, however you might need the very first execution to force an asynchronous boundary.

    start

    is the TrampolinedRunnable instance that will get executed and that is supposed to trigger the execution of other trampolined runnables

    s

    is the scheduler that gets used for execution.

  7. final class TestScheduler extends ReferenceScheduler with BatchingScheduler

    A scheduler meant for testing purposes.

  8. final class TrampolineExecutionContext extends ExecutionContext

    A scala.concurrentExecutionContext implementation that executes runnables immediately, on the current thread, by means of a trampoline implementation.

    A scala.concurrentExecutionContext implementation that executes runnables immediately, on the current thread, by means of a trampoline implementation.

    Can be used in some cases to keep the asynchronous execution on the current thread, as an optimization, but be warned, you have to know what you're doing.

    The TrampolineExecutionContext keeps a reference to another underlying context, to which it defers for:

    • reporting errors
    • deferring the rest of the queue in problematic situations

    Deferring the rest of the queue happens:

    • in case we have a runnable throwing an exception, the rest of the tasks get re-scheduled for execution by using the underlying context
    • in case we have a runnable triggering a Scala blocking context, the rest of the tasks get re-scheduled for execution on the underlying context to prevent any deadlocks

    Thus this implementation is compatible with the scala.concurrent.BlockContext, detecting blocking blocks and reacting by forking the rest of the queue to prevent deadlocks.

  9. final class TrampolineScheduler extends Scheduler

    A Scheduler implementation that executes runnables immediately, on the current thread, by means of a trampoline implementation.

    A Scheduler implementation that executes runnables immediately, on the current thread, by means of a trampoline implementation.

    Can be used in some cases to keep the asynchronous execution on the current thread, as an optimization, but be warned, you have to know what you're doing.

    The TrampolineScheduler keeps a reference to another underlying scheduler, to which it defers for:

    • reporting errors
    • time-delayed execution
    • deferring the rest of the queue in problematic situations

    Deferring the rest of the queue happens:

    • in case we have a runnable throwing an exception, the rest of the tasks get re-scheduled for execution by using the underlying scheduler
    • in case we have a runnable triggering a Scala blocking context, the rest of the tasks get re-scheduled for execution on the underlying scheduler to prevent any deadlocks

    Thus this implementation is compatible with the scala.concurrent.BlockContext, detecting blocking blocks and reacting by forking the rest of the queue to prevent deadlocks.

  10. abstract class TrampolinedRunnable extends Runnable with OnCompleteRunnable

    A marker for callbacks that can be batched and executed locally (on the current thread) by means of a trampoline (if the execution context / scheduler allows it).

    A marker for callbacks that can be batched and executed locally (on the current thread) by means of a trampoline (if the execution context / scheduler allows it).

    Idea was taken from the scala.concurrent.Future implementation. Credit should be given where due.

    DO NOT use unless you know what you're doing.

  11. type LocalBatchingExecutor = BatchingScheduler

    Deprecated.

    Deprecated. Renamed to BatchingScheduler.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.1.0) Renamed to BatchingScheduler

  12. type LocalRunnable = TrampolinedRunnable

    Deprecated.

    Deprecated. Renamed to TrampolinedRunnable.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.1.0) Renamed to TrampolinedRunnable

Inherited from AnyRef

Inherited from Any

Ungrouped