public class CompletionContext<Result extends Failable,V> extends java.lang.Object implements Completable<Result,V>, ExecutionContext, ResultView<Result,V>
| Constructor and Description |
|---|
CompletionContext() |
CompletionContext(long permits) |
CompletionContext(long startTime,
Completable<Result,V> wrappedCompletable) |
CompletionContext(long permits,
long startTime) |
CompletionContext(long permits,
long startTime,
Completable<Result,V> wrappedCompletable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
complete(Result result,
V value)
Completes this context successfully with the result.
|
boolean |
completeExceptionally(Result result,
java.lang.Throwable exception)
Completes this context with an exception.
|
java.lang.Throwable |
getError()
Return the exception that might have occurred during a failed execution.
|
Result |
getResult()
Return the result of the execution.
|
V |
getValue()
Return the value of a successful execution.
|
void |
internalOnComplete(PrecipiceFunction<Result,ExecutionContext> fn) |
long |
permitCount()
Returns the number of guard rail permits that this task required.
|
ResultView<Result,V> |
resultView()
Returns a view of the result of of this completable.
|
long |
startNanos()
Returns the time that the guard rail approved the execution of this task.
|
public CompletionContext()
public CompletionContext(long permits)
public CompletionContext(long permits,
long startTime)
public CompletionContext(long startTime,
Completable<Result,V> wrappedCompletable)
public CompletionContext(long permits,
long startTime,
Completable<Result,V> wrappedCompletable)
public long startNanos()
ExecutionContextstartNanos in interface ExecutionContextpublic long permitCount()
ExecutionContextpermitCount in interface ExecutionContextpublic boolean complete(Result result, V value)
Completablecomplete in interface Completable<Result extends Failable,V>result - of the computationvalue - of the computationpublic boolean completeExceptionally(Result result, java.lang.Throwable exception)
CompletablecompleteExceptionally in interface Completable<Result extends Failable,V>result - of the computationexception - of the computationpublic ResultView<Result,V> resultView()
CompletableresultView in interface Completable<Result extends Failable,V>public V getValue()
ResultViewgetValue in interface ResultView<Result extends Failable,V>public java.lang.Throwable getError()
ResultViewgetError in interface ResultView<Result extends Failable,V>public Result getResult()
ResultViewgetResult in interface ResultView<Result extends Failable,V>public void internalOnComplete(PrecipiceFunction<Result,ExecutionContext> fn)
Copyright © 2014 Tim Brooks. All Rights Reserved.