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.
- Alphabetic
- By Inheritance
- Sequencer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
next: Int
- returns
the next sequence number to be executed
-
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
Concrete 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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... )