trait Scheduling extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Scheduling
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract val executorService: ScheduledExecutorService
    Attributes
    protected
  2. abstract val onError: (Throwable) ⇒ Unit

Concrete 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 finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  15. def runPeriodically[R](firstRun: DateTime, whenToReRun: ⇒ Option[DateTime])(f: ⇒ R): Unit

    periodically runs f, starting on firstRun and repeating according to the calculated "process" value.

    periodically runs f, starting on firstRun and repeating according to the calculated "process" value.

    example: import org.scala_tools.time.Imports._ val executorService = ExecutorServiceManager.newScheduledThreadPool(5) val start = System.currentTimeMillis executorService.runPeriodically(DateTime.now + 50.millis, Some(DateTime.now + 1.second)) { // should print dt 6 times, once per second println("dt:%d".format(System.currentTimeMillis - start)) } Thread.sleep(5500) executorService.shutdownAndAwaitTermination(DateTime.now + 100.millis)

    If the task throws an exception, the onError function will be called to log the error (by default it prints the stacktrace to the console)

    If the process throws an exception, the scheduling of the task will stop.

    firstRun

    DateTime of the first run, i.e. DateTime.now + 2.seconds

    whenToReRun

    a by-value parameter specifying the next time the task should run. The value is calculated after f is executed and if None the task will not be executed anymore.

    f

    the task

  16. def runPeriodically[R](firstRun: DateTime, process: (Option[R]) ⇒ Option[DateTime])(f: ⇒ R): Unit

    runs a task periodically.

    runs a task periodically. The task initially runs on firstTime. The result R is then used to call process(R) and if that returns a new DateTime, the task will be executed again on that time. If process(R) returns None, the task won't be executed again.

    This method returns straight away, any processing occurs on separate threads using the executor.

    If the task throws an exception, the onError function will be called to log the error (by default it prints the stacktrace to the console)

    If the process throws an exception, the scheduling of the task will stop.

    firstRun

    DateTime of the first run, i.e. DateTime.now + 2.seconds

    process

    a function to process the result and specify the next time the task should run. The value is calculated after f is executed and if None the task will not be executed anymore.

    f

    the task

  17. def schedule[R](runAt: DateTime): (⇒ R) ⇒ ScheduledFuture[R]

    schedule a task to run in the future.

    schedule a task to run in the future.

    example: usage: val future=schedule(DateTime.now + 2.days) { // to do in 2 days from now }

  18. def schedule[R](delay: Long, unit: TimeUnit)(f: ⇒ R): ScheduledFuture[R]

    schedules a task to run in the future

    schedules a task to run in the future

    example:

    val future=schedule(100,TimeUnit.MILLISECONDS) { // to do in 100 millis from now } ... val result=future.get

  19. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped