Package akka.util
Class SerializedSuspendableExecutionContext
- java.lang.Object
-
- java.util.concurrent.atomic.AtomicReference<AbstractNodeQueue.Node<T>>
-
- akka.dispatch.AbstractNodeQueue<java.lang.Runnable>
-
- akka.util.SerializedSuspendableExecutionContext
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Runnable
,scala.concurrent.ExecutionContext
public final class SerializedSuspendableExecutionContext extends AbstractNodeQueue<java.lang.Runnable> implements java.lang.Runnable, scala.concurrent.ExecutionContext
Resumes execution of tasks untilsuspend
is called, if it isn't currently suspended, it is a no-op. This operation is idempotent.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.dispatch.AbstractNodeQueue
AbstractNodeQueue.Node<T>
-
-
Constructor Summary
Constructors Constructor Description SerializedSuspendableExecutionContext(int throughput, scala.concurrent.ExecutionContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SerializedSuspendableExecutionContext
apply(int throughput, scala.concurrent.ExecutionContext context)
void
attach()
scala.concurrent.ExecutionContext
context()
void
execute(java.lang.Runnable task)
static int
Off()
static int
On()
void
reportFailure(java.lang.Throwable t)
void
resume()
Resumes execution of tasks untilsuspend
is called, if it isn't currently suspended, it is a no-op.void
run()
int
size()
O(N)void
suspend()
Suspends execution of tasks untilresume
is called, this operation is idempotent.static int
Suspended()
java.lang.String
toString()
-
Methods inherited from class akka.dispatch.AbstractNodeQueue
add, addNode, count, isEmpty, peek, peekNode, poll, pollNode
-
Methods inherited from class java.util.concurrent.atomic.AtomicReference
accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
-
-
-
Method Detail
-
Off
public static final int Off()
-
On
public static final int On()
-
Suspended
public static final int Suspended()
-
apply
public static SerializedSuspendableExecutionContext apply(int throughput, scala.concurrent.ExecutionContext context)
-
context
public scala.concurrent.ExecutionContext context()
-
resume
public final void resume()
Resumes execution of tasks untilsuspend
is called, if it isn't currently suspended, it is a no-op. This operation is idempotent.
-
suspend
public final void suspend()
Suspends execution of tasks untilresume
is called, this operation is idempotent.
-
run
public final void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
attach
public final void attach()
-
execute
public final void execute(java.lang.Runnable task)
- Specified by:
execute
in interfacescala.concurrent.ExecutionContext
-
reportFailure
public final void reportFailure(java.lang.Throwable t)
- Specified by:
reportFailure
in interfacescala.concurrent.ExecutionContext
-
size
public final int size()
O(N)- Returns:
- the number of Runnable's currently enqueued
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.util.concurrent.atomic.AtomicReference<AbstractNodeQueue.Node<java.lang.Runnable>>
-
-