Packages

trait Sequencer extends AnyRef

A trait used to guarantee a series of unordered tasks occur sequentially. By associating a sequence number with each task, the sequencer can determine whether to immediately run a task or queue the task for later. When a task has been queued and the sequence number for that task has been reached, the task is removed from the queue and executed. The sequence number is only advanced after the task completes.

Note: it is assumed each task has a unique sequence number. A request to execute a task with a sequence number that is less than the current sequence number causes an IllegalArgumentException to be thrown.

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

Abstract Value Members

  1. abstract def next: Int

    returns

    the next sequence number to be executed

  2. abstract def when[X](sequenceNumber: Int)(task: ⇒ Future[X])(implicit ec: ExecutionContext): DeferredFuture[X]

    returns

    a Future that completes once the sequence number has been reached and the task has completed

    Exceptions thrown

    java.lang.IllegalArgumentException if sequenceNumber is less than next