monix.execution.Scheduler

Extensions

implicit final class Extensions extends AnyVal

Utilities complementing the Scheduler interface.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Extensions
  2. AnyVal
  3. NotNull
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Extensions(source: Scheduler)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def executeAsync(cb: ⇒ Unit): Unit

    Schedules the given callback for immediate asynchronous execution in the thread-pool.

    Schedules the given callback for immediate asynchronous execution in the thread-pool.

    Described as a macro, thus it has zero overhead compared to doing execute(new Runnable { ... })

    cb

    the callback to execute asynchronously

    Annotations
    @macroImpl( ... )
  6. def executeLocal(cb: ⇒ Unit): Unit

    Schedules the given callback for immediate execution as a LocalRunnable.

    Schedules the given callback for immediate execution as a LocalRunnable. Depending on the execution context, it might get executed on the current thread by using an internal trampoline, so it is still safe from stack-overflow exceptions.

    Described as a macro, thus it has zero overhead compared to doing execute(new LocalRunnable { ... })

    cb

    the callback to execute asynchronously

    Annotations
    @macroImpl( ... )
  7. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  8. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  9. def scheduleAtFixedRate(initialDelay: FiniteDuration, period: FiniteDuration)(action: ⇒ Unit): Cancelable

    Schedules a periodic task that becomes enabled first after the given initial delay, and subsequently with the given period.

    Schedules a periodic task that becomes enabled first after the given initial delay, and subsequently with the given period. Executions will commence after initialDelay then initialDelay + period, then initialDelay + 2 * period and so on.

    If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the scheduler. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.

    For example the following schedules a message to be printed to standard output approximately every 10 seconds with an initial delay of 5 seconds:

    val task = scheduler.scheduleAtFixedRate(5.seconds, 10.seconds) {
      print("Repeated message")
    }
    
    // later if you change your mind ...
    task.cancel()
    initialDelay

    is the time to wait until the first execution happens

    period

    is the time to wait between 2 successive executions of the task

    action

    is the callback to be executed

    returns

    a cancelable that can be used to cancel the execution of this repeated task at any time.

  10. def scheduleOnce(initialDelay: FiniteDuration)(action: ⇒ Unit): Cancelable

    Schedules a task to run in the future, after initialDelay.

    Schedules a task to run in the future, after initialDelay.

    For example the following schedules a message to be printed to standard output after 5 minutes:

    val task = scheduler.scheduleOnce(5.minutes) {
      print("Hello, world!")
    }
    
    // later, if you change your mind ...
    task.cancel()
    initialDelay

    is the time to wait until the execution happens

    action

    is the callback to be executed

    returns

    a Cancelable that can be used to cancel the created task before execution.

  11. def scheduleWithFixedDelay(initialDelay: FiniteDuration, delay: FiniteDuration)(action: ⇒ Unit): Cancelable

    Schedules for execution a periodic task that is first executed after the given initial delay and subsequently with the given delay between the termination of one execution and the commencement of the next.

    Schedules for execution a periodic task that is first executed after the given initial delay and subsequently with the given delay between the termination of one execution and the commencement of the next.

    For example the following schedules a message to be printed to standard output every 10 seconds with an initial delay of 5 seconds:

    val task = s.scheduleWithFixedDelay(5.seconds, 10.seconds) {
      print("Repeated message")
    }
    
    // later if you change your mind ...
    task.cancel()
    initialDelay

    is the time to wait until the first execution happens

    delay

    is the time to wait between 2 successive executions of the task

    action

    is the callback to be executed

    returns

    a cancelable that can be used to cancel the execution of this repeated task at any time.

  12. val source: Scheduler

  13. def toString(): String

    Definition Classes
    Any

Inherited from AnyVal

Inherited from NotNull

Inherited from Any

Ungrouped