object Scheduler extends SchedulerCompanionImpl with Serializable
- Source
 - Scheduler.scala
 
- Alphabetic
 - By Inheritance
 
- Scheduler
 - Serializable
 - Serializable
 - SchedulerCompanionImpl
 - SchedulerCompanion
 - AnyRef
 - Any
 
- Hide All
 - Show All
 
- Public
 - All
 
Type Members
- 
      
      
      
        
      
    
      
        implicit final 
        class
      
      
        
              Extensions
             extends AnyVal with ExecuteExtensions
      
      
      
Utilities complementing the
Schedulerinterface. - 
      
      
      
        
      
    
      
        
        trait
      
      
        ImplicitsLike extends AnyRef
      
      
      
- Definition Classes
 - SchedulerCompanion
 
 
Value Members
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        !=(arg0: Any): Boolean
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        ##(): Int
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        ==(arg0: Any): Boolean
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        
        lazy val
      
      
        DefaultScheduledExecutor: ScheduledExecutorService
      
      
      
The default
ScheduledExecutorinstance.The default
ScheduledExecutorinstance.Currently it's a single-threaded Java
ScheduledExecutorServiceused 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.- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(executionModel: ExecutionModel): Scheduler
      
      
      
Scheduler builder - uses monix's default
ScheduledExecutorServicefor handling the scheduling of tasks.Scheduler builder - uses monix's default
ScheduledExecutorServicefor handling the scheduling of tasks. Uses Scala'ss.c.ExecutionContext.globalfor actual execution.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(reporter: UncaughtExceptionReporter, executionModel: ExecutionModel): Scheduler
      
      
      
Scheduler builder - uses monix's default
ScheduledExecutorServicefor handling the scheduling of tasks.Scheduler builder - uses monix's default
ScheduledExecutorServicefor handling the scheduling of tasks. Uses Scala'ss.c.ExecutionContext.globalfor actual execution.- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(ec: ExecutionContext, executionModel: ExecutionModel): Scheduler
      
      
      
Scheduler builder - uses monix's default
ScheduledExecutorServicefor handling the scheduling of tasks.Scheduler builder - uses monix's default
ScheduledExecutorServicefor handling the scheduling of tasks.- ec
 is the execution context in 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.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(ec: ExecutionContext): Scheduler
      
      
      
Scheduler builder - uses monix's default
ScheduledExecutorServicefor handling the scheduling of tasks.Scheduler builder - uses monix's default
ScheduledExecutorServicefor handling the scheduling of tasks.- ec
 is the execution context in which all tasks will run.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(executor: ScheduledExecutorService, executionModel: ExecutionModel): Scheduler
      
      
      
Scheduler builder that converts a Java
ScheduledExecutorServiceinto a scheduler.Scheduler builder that converts a Java
ScheduledExecutorServiceinto a scheduler.- executor
 is the
ScheduledExecutorServicethat 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.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(executor: ScheduledExecutorService): Scheduler
      
      
      
Scheduler builder that converts a Java
ScheduledExecutorServiceinto a scheduler.Scheduler builder that converts a Java
ScheduledExecutorServiceinto a scheduler.- executor
 is the
ScheduledExecutorServicethat 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.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(executor: ScheduledExecutorService, reporter: UncaughtExceptionReporter, executionModel: ExecutionModel): Scheduler
      
      
      
Scheduler builder that converts a Java
ScheduledExecutorServiceinto a scheduler.Scheduler builder that converts a Java
ScheduledExecutorServiceinto a scheduler.- executor
 is the
ScheduledExecutorServicethat 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.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(executor: ScheduledExecutorService, reporter: UncaughtExceptionReporter): Scheduler
      
      
      
Scheduler builder that converts a Java
ScheduledExecutorServiceinto a scheduler.Scheduler builder that converts a Java
ScheduledExecutorServiceinto a scheduler.- executor
 is the
ScheduledExecutorServicethat 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.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(ec: ExecutionContext, reporter: UncaughtExceptionReporter, executionModel: ExecutionModel): Scheduler
      
      
      
Scheduler builder .
Scheduler builder .
- ec
 is the execution context in which all tasks will run. Use
scala.concurrent.ExecutionContext.Implicits.globalfor the default.- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(ec: ExecutionContext, reporter: UncaughtExceptionReporter): Scheduler
      
      
      
Scheduler builder.
Scheduler builder.
- ec
 is the execution context in which all tasks will run. Use
scala.concurrent.ExecutionContext.Implicits.globalfor the default.- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(executor: ScheduledExecutorService, ec: ExecutionContext): Scheduler
      
      
      
Scheduler builder.
Scheduler builder.
- executor
 is the
ScheduledExecutorServicethat 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.- ec
 is the execution context in which all tasks will run. Use
scala.concurrent.ExecutionContext.Implicits.globalfor the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        apply(executor: ScheduledExecutorService, ec: ExecutionContext, reporter: UncaughtExceptionReporter, executionModel: ExecutionModel): Scheduler
      
      
      
Scheduler builder.
Scheduler builder.
The resulting Scheduler will piggyback on top of a Java
ScheduledExecutorServicefor scheduling tasks for execution with a delay and a ScalaExecutionContextfor actually executing the tasks.- executor
 is the
ScheduledExecutorServicethat 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.- ec
 is the execution context in which all tasks will run. Use
scala.concurrent.ExecutionContext.Implicits.globalfor the default.- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        asInstanceOf[T0]: T0
      
      
      
- Definition Classes
 - Any
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        cached(name: String, minThreads: Int, maxThreads: Int, keepAliveTime: FiniteDuration = 60.seconds, daemonic: Boolean = true, reporter: UncaughtExceptionReporter = LogExceptionsToStandardErr, executionModel: ExecutionModel = ExecutionModel.Default): Scheduler
      
      
      
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.- name
 the created threads name prefix, for easy identification
- minThreads
 the number of threads to keep in the pool, even if they are idle
- maxThreads
 the maximum number of threads to allow in the pool
- 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
- daemonic
 specifies whether the created threads should be daemonic (non-daemonic threads are blocking the JVM process on exit).
- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        clone(): AnyRef
      
      
      
- Attributes
 - protected[java.lang]
 - Definition Classes
 - AnyRef
 - Annotations
 - @throws( ... )
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        computation(parallelism: Int, reporter: UncaughtExceptionReporter = LogExceptionsToStandardErr, executionModel: ExecutionModel = ExecutionModel.Default): Scheduler
      
      
      
Creates a Scheduler meant for computational heavy tasks.
Creates a Scheduler meant for computational heavy tasks.
Characteristics:
- backed by Scala's
ForkJoinPoolfor the task execution, in async mode - uses monix's defaultScheduledExecutorServiceinstance for scheduling - all created threads are daemonic - cooperates with Scala'sBlockContext- parallelism
 is the number of threads that can run in parallel
- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        eq(arg0: AnyRef): Boolean
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        equals(arg0: Any): Boolean
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        finalize(): Unit
      
      
      
- Attributes
 - protected[java.lang]
 - Definition Classes
 - AnyRef
 - Annotations
 - @throws( classOf[java.lang.Throwable] )
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        fixedPool(name: String, poolSize: Int, daemonic: Boolean = true, reporter: UncaughtExceptionReporter = LogExceptionsToStandardErr, executionModel: ExecutionModel = ExecutionModel.Default): Scheduler
      
      
      
Builds a Scheduler with a fixed thread-pool.
Builds a Scheduler with a fixed thread-pool.
Characteristics:
- backed by a fixed pool
ScheduledExecutorServicethat takes care of both scheduling tasks in the future and of executing immediate tasks - does not cooperate with Scala'sBlockingContext, so tasks should not block on the result of other tasks scheduled to run on this same thread- name
 the created threads name prefix, for easy identification.
- daemonic
 specifies whether the created thread should be daemonic
- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        getClass(): Class[_]
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        global: Scheduler
      
      
      
The explicit global
Scheduler.The explicit global
Scheduler. Invokeglobalwhen you want to provide the globalSchedulerexplicitly.The default
Schedulerimplementation is backed by a work-stealing thread pool, along with a single-threadedScheduledExecutionContextthat 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
- Definition Classes
 - SchedulerCompanionImpl → SchedulerCompanion
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        hashCode(): Int
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        io(name: String = "monix-io", daemonic: Boolean = true, reporter: UncaughtExceptionReporter = LogExceptionsToStandardErr, executionModel: ExecutionModel = ExecutionModel.Default): Scheduler
      
      
      
Creates a Scheduler meant for blocking I/O tasks.
Creates a Scheduler meant for blocking I/O tasks.
Characteristics:
- backed by a cached
ThreadPoolexecutor with 60 seconds of keep-alive - the maximum number of threads is unbounded, as recommended for blocking I/O - uses monix's defaultScheduledExecutorServiceinstance for scheduling - doesn't cooperate with Scala'sBlockContextbecause it is unbounded- name
 the created threads name prefix, for easy identification.
- daemonic
 specifies whether the created threads should be daemonic (non-daemonic threads are blocking the JVM process on exit).
- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        isInstanceOf[T0]: Boolean
      
      
      
- Definition Classes
 - Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        ne(arg0: AnyRef): Boolean
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        notify(): Unit
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        notifyAll(): Unit
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        singleThread(name: String, daemonic: Boolean = true, reporter: UncaughtExceptionReporter = LogExceptionsToStandardErr, executionModel: ExecutionModel = ExecutionModel.Default): Scheduler
      
      
      
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
ScheduledExecutorServicethat takes care of both scheduling tasks in the future and of executing tasks - does not cooperate with Scala'sBlockingContext, so tasks should not block on the result of other tasks scheduled to run on this same thread- name
 is the name of the created thread, for easy identification
- daemonic
 specifies whether the created thread should be daemonic (non-daemonic threads are blocking the JVM process on exit)
- reporter
 is the UncaughtExceptionReporter that logs uncaught exceptions. Wrap the given
ExecutionContext.reportFailureor use UncaughtExceptionReporter.LogExceptionsToStandardErr for the default.- executionModel
 is the preferred ExecutionModel, a guideline for run-loops and producers of data. Use ExecutionModel.Default for the default.
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        synchronized[T0](arg0: ⇒ T0): T0
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        toString(): String
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        trampoline(underlying: Scheduler = Implicits.global, executionModel: ExecutionModel = ExecutionModel.Default): Scheduler
      
      
      
Builds a TrampolineScheduler.
Builds a TrampolineScheduler.
- underlying
 is the Scheduler to which the we defer to in case asynchronous or time-delayed execution is needed
- Definition Classes
 - SchedulerCompanionImpl
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(): Unit
      
      
      
- Definition Classes
 - AnyRef
 - Annotations
 - @throws( ... )
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(arg0: Long, arg1: Int): Unit
      
      
      
- Definition Classes
 - AnyRef
 - Annotations
 - @throws( ... )
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(arg0: Long): Unit
      
      
      
- Definition Classes
 - AnyRef
 - Annotations
 - @throws( ... )
 
 - 
      
      
      
        
      
    
      
        
        object
      
      
        Implicits extends schedulers.SchedulerCompanionImpl.ImplicitsLike
      
      
      
- Definition Classes
 - SchedulerCompanionImpl → SchedulerCompanion
 
 

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.