com.amazonaws.services.simpleworkflow.flow.core
Class AsyncScope
java.lang.Object
com.amazonaws.services.simpleworkflow.flow.core.AsyncScope
- All Implemented Interfaces:
- Cancelable
public abstract class AsyncScope
- extends java.lang.Object
- implements Cancelable
Interface between synchronous and asynchronous code. Serves as a root scope
for asynchronous computation and as event loop for the owning synchronous
code.
|
Constructor Summary |
AsyncScope()
|
AsyncScope(boolean disableAsyncStackTrace,
boolean excludeAsyncScopeStack)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsyncScope
public AsyncScope()
AsyncScope
public AsyncScope(boolean disableAsyncStackTrace,
boolean excludeAsyncScopeStack)
cancel
public void cancel(java.lang.Throwable cause)
- Specified by:
cancel in interface Cancelable
isCancelRequested
public boolean isCancelRequested()
- Specified by:
isCancelRequested in interface Cancelable
getAsynchronousThreadDump
public java.util.List<AsyncTaskInfo> getAsynchronousThreadDump()
getAsynchronousThreadDumpAsString
public java.lang.String getAsynchronousThreadDumpAsString()
eventLoop
public boolean eventLoop()
throws java.lang.Throwable
- Execute all queued tasks. If execution of those tasks result in addition
of new tasks to the queue execute them as well.
Unless there are external dependencies or bugs single call to this method
performs the complete asynchronous execution.
In presence of external dependencies it is expected that
eventLoop() is called every time after change in their state
can unblock the asynchronous execution.
- Returns:
- true means there are no tasks originated from this scope that are
not done yet.
- Throws:
java.lang.Throwable
isComplete
public boolean isComplete()
getFailure
public java.lang.Throwable getFailure()
Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.