odelay
package odelay
Odelay defines a set of primitives for delaying the execution of operations.
This is differs from scala.concurrent.Futures in that the execution of an operation will not occur until a provided delay, specified as a scala.concurrent.duration.Duration. The delay of a task may also may be canceled. Operations may also be executed after a series of delays, also represented by scala.concurrent.duration.Durations.
These primitives can be used to complement the usage of scala.concurrent.Futures by defining a deterministic delay for the future operation as well as a way to cancel the future operation.
An odelay.Delay represents a delayed operation and defines a future method which may be used to trigger dependent actions and delay cancellations.
- Alphabetic
- By Inheritance
- odelay
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait Delay[T] extends AnyRef
A Delay is the default of a deferred operation
- trait PeriodicDelay[T] extends Delay[T]
- abstract class PeriodicPromisingDelay[T] extends PromisingDelay[T] with PeriodicDelay[T]
- abstract class PromisingDelay[T] extends Delay[T]
A building block for writing your own odelay.Timer.
A building block for writing your own odelay.Timer. Call
completePromise(_)
with the value of the result of the operation. CallcancelPromise()
to cancel it. To query the current state of the promise, usepromiseIncomplete
- trait SelfCancelation[T] extends AnyRef
If calling cancel on a Delay's implemention has no other effect than cancelling the underlying promise.
If calling cancel on a Delay's implemention has no other effect than cancelling the underlying promise. Use this as a mix in.
val timer = new Timer { def apply(delay: FiniteDuration, op: => T) = new PromisingDelay[T] with SelfCancelation[T] { schedule(delay, completePromise(op)) } ... }
- trait Timer extends AnyRef
The deferrer of some arbitrary operation
The deferrer of some arbitrary operation
- Annotations
- @implicitNotFound()
Value Members
- object Delay
Provides an interface for producing Delays.
Provides an interface for producing Delays. Use requires an implicit odelay.Timer to be in implicit scope.
val delay = odelay.Delay(2.seconds) { todo }
- object Timer
Defines default configurations for timers