package schedulers
- Source
 - package.scala
 
- Alphabetic
 - By Inheritance
 
- schedulers
 - AnyRef
 - Any
 
- Hide All
 - Show All
 
- Public
 - All
 
Type Members
- 
      
      
      
        
      
    
      
        final 
        class
      
      
        AsyncScheduler extends ReferenceScheduler with BatchingScheduler
      
      
      
An
AsyncSchedulerschedules tasks to happen in the future with the givenScheduledExecutorServiceand the tasks themselves are executed on the givenExecutionContext. - 
      
      
      
        
      
    
      
        
        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 byTaskin processing its internal callbacks. - 
      
      
      
        
      
    
      
        abstract 
        class
      
      
        ExecutorScheduler extends SchedulerService with ReferenceScheduler with BatchingScheduler
      
      
      
An ExecutorScheduler is a class for building a SchedulerService out of a Java
ExecutorService. - 
      
      
      
        
      
    
      
        
        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.
 - 
      
      
      
        
      
    
      
        
        trait
      
      
        SchedulerService extends Scheduler
      
      
      
A Scheduler type that provides methods for managing termination.
A Scheduler type that provides methods for managing termination.
A
SchedulerServicecan be shut down, which will cause it to reject new tasks. Theshutdownmethod allows previously submitted tasks to execute before terminating. TheawaitTerminationmethod allows waiting on all active tasks to finish.Upon termination, an executor has no tasks actively executing, no tasks awaiting execution, and no new tasks can be submitted. An unused
SchedulerServiceshould be shut down to allow reclamation of its resources. - 
      
      
      
        
      
    
      
        final 
        class
      
      
        ShiftedRunnable extends Runnable
      
      
      
Runnable that defers the execution of the given reference with an
executeAsync.Runnable that defers the execution of the given reference with an
executeAsync.This is useful for example when implementing
scheduleOnce, to introduce a boundary between the scheduling and the execution, otherwise risk executing the runnable on the wrong thread-pool. - 
      
      
      
        
      
    
      
        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.
 - 
      
      
      
        
      
    
      
        final 
        class
      
      
        TestScheduler extends ReferenceScheduler with BatchingScheduler
      
      
      
A scheduler meant for testing purposes.
 - 
      
      
      
        
      
    
      
        final 
        class
      
      
        TrampolineExecutionContext extends ExecutionContext
      
      
      
A
scala.concurrentExecutionContextimplementation that executes runnables immediately, on the current thread, by means of a trampoline implementation.A
scala.concurrentExecutionContextimplementation 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
TrampolineExecutionContextkeeps a reference to anotherunderlyingcontext, 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 
underlyingcontext - in case we have a runnable triggering a Scala 
blockingcontext, the rest of the tasks get re-scheduled for execution on theunderlyingcontext to prevent any deadlocks 
Thus this implementation is compatible with the
scala.concurrent.BlockContext, detectingblockingblocks and reacting by forking the rest of the queue to prevent deadlocks. - 
      
      
      
        
      
    
      
        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
TrampolineSchedulerkeeps a reference to anotherunderlyingscheduler, 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 
underlyingscheduler - in case we have a runnable triggering a Scala 
blockingcontext, the rest of the tasks get re-scheduled for execution on theunderlyingscheduler to prevent any deadlocks 
Thus this implementation is compatible with the
scala.concurrent.BlockContext, detectingblockingblocks and reacting by forking the rest of the queue to prevent deadlocks. - 
      
      
      
        
      
    
      
        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.Futureimplementation. Credit should be given where due.DO NOT use unless you know what you're doing.
 - 
      
      
      
        
      
    
      
        
        type
      
      
        ExecutionModel = execution.ExecutionModel
      
      
      
Deprecated.
Deprecated. Moved to monix.execution.ExecutionModel.
- Annotations
 - @deprecated
 - Deprecated
 (Since version 2.1.3) Moved to
monix.execution.ExecutionModel
 - 
      
      
      
        
      
    
      
        
        type
      
      
        LocalBatchingExecutor = BatchingScheduler
      
      
      
Deprecated.
Deprecated. Renamed to BatchingScheduler.
- Annotations
 - @deprecated
 - Deprecated
 (Since version 2.1.0) Renamed to
BatchingScheduler
 - 
      
      
      
        
      
    
      
        
        type
      
      
        LocalRunnable = TrampolinedRunnable
      
      
      
Deprecated.
Deprecated. Renamed to TrampolinedRunnable.
- Annotations
 - @deprecated
 - Deprecated
 (Since version 2.1.0) Renamed to
TrampolinedRunnable
 
Value Members
-  object AsyncScheduler extends Serializable
 -  object ExecutorScheduler extends Serializable
 -  object ReferenceScheduler extends Serializable
 -  object SchedulerService extends Serializable
 -  object TestScheduler extends Serializable
 -  object TrampolineExecutionContext
 -  object TrampolineScheduler extends Serializable
 
Deprecated Value Members
- 
      
      
      
        
      
    
      
        
        object
      
      
        ExecutionModel extends Serializable
      
      
      
Deprecated.
Deprecated. Moved to monix.execution.ExecutionModel.
- Annotations
 - @deprecated
 - Deprecated
 (Since version 2.1.3) Moved to
monix.execution.ExecutionModel
 

This is the API documentation for the Monix library.
Package Overview
monix.execution exposes lower level primitives for dealing with asynchronous execution:
Atomictypes, as alternative tojava.util.concurrent.atomicmonix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observablepattern:Observableimplementationsmonix.types implements type-class shims, to be translated to type-classes provided by libraries such as Cats or Scalaz.
monix.cats is the optional integration with the Cats library, providing translations for the types described in
monix.types.monix.scalaz is the optional integration with the Scalaz library, providing translations for the types described in
monix.types.