monifu.concurrent.schedulers

AsyncScheduler

final class AsyncScheduler extends Scheduler

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

Linear Supertypes
Scheduler, UncaughtExceptionReporter, ExecutionContext, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncScheduler
  2. Scheduler
  3. UncaughtExceptionReporter
  4. ExecutionContext
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

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

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

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

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  8. def execute(runnable: Runnable): Unit

    Runs a block of code in this ExecutionContext.

    Runs a block of code in this ExecutionContext.

    Definition Classes
    AsyncSchedulerScheduler → ExecutionContext
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  16. def prepare(): ExecutionContext

    Definition Classes
    ExecutionContext
  17. def reportFailure(t: Throwable): Unit

    Reports that an asynchronous computation failed.

    Reports that an asynchronous computation failed.

    Definition Classes
    AsyncSchedulerSchedulerUncaughtExceptionReporter → ExecutionContext
  18. 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, {
      println("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.

    Definition Classes
    AsyncSchedulerScheduler
  19. def scheduleOnce(action: ⇒ Unit): Cancelable

    Schedules the given action for immediate execution.

    Schedules the given action for immediate execution.

    returns

    a Cancelable that can be used to cancel the task in case it hasn't been executed yet.

    Definition Classes
    Scheduler
  20. def scheduleRecursive(initialDelay: FiniteDuration, delay: FiniteDuration, action: (() ⇒ Unit) ⇒ Unit): Cancelable

    Schedules a task for periodic execution.

    Schedules a task for periodic execution. The callback scheduled for execution receives a function as parameter, a function that can be used to reschedule the execution or consequently to stop it.

    This variant of scheduleRepeated is useful if at some point you want to stop the execution from within the callback.

    The following increments a number every 5 seconds until the number reaches 20, then prints a message and stops:

    var counter = 0
    
    scheduler.schedule(5.seconds, 5.seconds, { reschedule =>
      count += 1
      if (counter < 20)
        reschedule()
      else
        println("Done!")
    })
    initialDelay

    is the time to wait until the first execution happens

    delay

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

    action

    is the callback to be executed

    returns

    a cancelable that can be used to cancel the task at any time.

    Definition Classes
    Scheduler
  21. def scheduleRepeated(initialDelay: FiniteDuration, delay: FiniteDuration, action: ⇒ Unit): Cancelable

    Overwritten for performance reasons.

    Overwritten for performance reasons.

    initialDelay

    is the time to wait until the first execution happens

    delay

    is the time to wait between 2 subsequent 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.

    Definition Classes
    AsyncSchedulerScheduler
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Scheduler

Inherited from UncaughtExceptionReporter

Inherited from ExecutionContext

Inherited from AnyRef

Inherited from Any

Ungrouped