public abstract class AsyncAgent
extends java.lang.Object
WhenReady patterns are called.
 This is a convenience base class for classes that perform async operations.WhenReady| Modifier | Constructor and Description | 
|---|---|
protected  | 
AsyncAgent(AsyncOptions asyncOptions)
Base constructor for derived classes to call. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
action()
 | 
java.util.concurrent.CompletableFuture<java.lang.Void> | 
applyAsync()
Starts a new  
WhenReady.applyAsync(java.util.function.Predicate<S>, java.util.function.Function<S, R>, S) operation. | 
protected boolean | 
done()
 | 
boolean | 
isIdle()
Checks whether this AsyncAgent is idle, i.e. 
 | 
protected boolean | 
ready()
The 'ready' predicate passed to  
WhenReady.completeAsync(java.util.function.Predicate<S>, R, S), WhenReady.applyAsync(java.util.function.Predicate<S>, java.util.function.Function<S, R>, S), or WhenReady.startApplyLoopAsync(java.util.function.Predicate<S>, java.util.function.Predicate<S>, java.util.function.Function<S, R>, S). | 
protected void | 
setIdle()
Marks this agent as 'idle'. 
 | 
protected void | 
setIdleAndThrow(java.lang.Throwable ex)
Throws an  
AsyncException to notify the WhenReady framework that something has gone wrong. | 
java.util.concurrent.CompletableFuture<java.lang.Void> | 
startApplyLoopAsync()
 | 
protected AsyncAgent(AsyncOptions asyncOptions)
asyncOptions - AsyncOptions that will control all async operations on this agent.public java.util.concurrent.CompletableFuture<java.lang.Void> applyAsync()
WhenReady.applyAsync(java.util.function.Predicate<S>, java.util.function.Function<S, R>, S) operation.public java.util.concurrent.CompletableFuture<java.lang.Void> startApplyLoopAsync()
WhenReady.startApplyLoopAsync(java.util.function.Predicate<S>, java.util.function.Predicate<S>, java.util.function.Function<S, R>, S) operation.action().protected boolean ready()
WhenReady.completeAsync(java.util.function.Predicate<S>, R, S), WhenReady.applyAsync(java.util.function.Predicate<S>, java.util.function.Function<S, R>, S), or WhenReady.startApplyLoopAsync(java.util.function.Predicate<S>, java.util.function.Predicate<S>, java.util.function.Function<S, R>, S).action().protected boolean done()
WhenReady.startApplyLoopAsync(java.util.function.Predicate<S>, java.util.function.Predicate<S>, java.util.function.Function<S, R>, S).protected void action()
WhenReady.applyAsync(java.util.function.Predicate<S>, java.util.function.Function<S, R>, S) or WhenReady.startApplyLoopAsync(java.util.function.Predicate<S>, java.util.function.Predicate<S>, java.util.function.Function<S, R>, S).
 Derived classes should override this method.
public boolean isIdle()
protected void setIdle()
protected void setIdleAndThrow(java.lang.Throwable ex)
AsyncException to notify the WhenReady framework that something has gone wrong.  
 Marks this agent as 'idle'.ex - An exception to complete with.