Trait/Object

s_mach.concurrent.util

ConcurrentTestContext

Related Docs: object ConcurrentTestContext | package util

Permalink

trait ConcurrentTestContext extends ExecutionContext with ScheduledExecutionContext

A context for testing concurrent code that provides: 1) an ExecutionContext that keeps track of the number of active and completed Runnables 2) a Timer for tracking elapsed duration since start of test 3) a SerializationSchedule for detecting order of execution of events 4) a precision delay function that accumulates any delay error

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConcurrentTestContext
  2. ScheduledExecutionContext
  3. ExecutionContext
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def activeExecutionCount: Int

    Permalink

    returns

    the current number of active Runnables and scheduled tasks being processed

  2. abstract def delay(delay_ns: Long): Unit

    Permalink

    precisely delay for a period of time in nanoseconds.

    precisely delay for a period of time in nanoseconds. If the elapsed time differs from the requested the delay, the error in delay is accumulated in delayError_ns

  3. abstract def delayError_ns: Long

    Permalink

    returns

    the accumulated delay error

  4. abstract def execute(runnable: Runnable): Unit

    Permalink
    Definition Classes
    ExecutionContext
  5. abstract def reportFailure(cause: Throwable): Unit

    Permalink

    Report a failure.

    Report a failure. Used to report failures during periodic tasks

    Definition Classes
    ScheduledExecutionContext
  6. implicit abstract def sched: SerializationSchedule[String]

    Permalink

    returns

    the SerializationSchedule for the context

  7. abstract def schedule[A](delay: FiniteDuration)(f: ⇒ A): DelayedFuture[A]

    Permalink

    Create a DelayedFuture that executes the supplied function after the given delay

    Create a DelayedFuture that executes the supplied function after the given delay

    delay

    the time from now to delay execution

    f

    the function to execute

    returns

    a DelayedFuture that can be used to extract result

    Definition Classes
    ScheduledExecutionContext
    Exceptions thrown

    java.util.concurrent.RejectedExecutionException if the task cannot be scheduled for execution

  8. abstract def scheduleAtFixedRate[U](initialDelay: FiniteDuration, period: FiniteDuration, paused: Boolean = false)(task: () ⇒ U): PeriodicTask

    Permalink

    Creates a PeriodicTask that executes first after the given initial delay, and subsequently with the given period.

    Creates a PeriodicTask that executes first after the given initial delay, and subsequently with the given period. PeriodicTask may stopped using the cancel method. If a failure occurs while processing the task, the task is automatically cancelled. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.

    initialDelay

    the time to delay first execution

    period

    the period between successive executions

    paused

    TRUE to start the periodic task paused FALSE to start running

    task

    the task to execute

    returns

    a PeriodicTask

    Definition Classes
    ScheduledExecutionContext
    Exceptions thrown

    java.lang.IllegalArgumentException if period less than or equal to zero

    java.util.concurrent.RejectedExecutionException if the task cannot be scheduled for execution

  9. abstract def scheduleCancellable[A](delay: FiniteDuration, fallback: ⇒ A)(f: ⇒ A): CancellableDelayedFuture[A]

    Permalink

    Create a DelayedFuture that executes the supplied function after the given delay

    Create a DelayedFuture that executes the supplied function after the given delay

    delay

    the time from now to delay execution

    fallback

    the value to return if the future is cancelled

    f

    the function to execute

    returns

    a DelayedFuture that can be used to extract result or cancel (only before it has been started)

    Definition Classes
    ScheduledExecutionContext
    Exceptions thrown

    java.util.concurrent.RejectedExecutionException if the task cannot be scheduled for execution

Concrete Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def prepare(): ExecutionContext

    Permalink
    Definition Classes
    ExecutionContext
  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def waitForActiveExecutionCount(_activeRunnableCount: Int): Unit

    Permalink

    Sleep until the active execution count is equal to or less than the specified value

Inherited from ScheduledExecutionContext

Inherited from ExecutionContext

Inherited from AnyRef

Inherited from Any

Ungrouped