public class AsyncContext extends Object implements EvalContext
EvalContext
that executes evaluation and Value
computations on a given
Executor
.
Override EvalContext.evaluate(Task)
to implement Value
memoization.
EvalContext.Promise<T>, EvalContext.Value<T>
LOG
Modifier and Type | Method and Description |
---|---|
static EvalContext |
create(Executor executor) |
<T> EvalContext.Value<T> |
evaluateInternal(Task<T> task,
EvalContext context)
A variant of
EvalContext.evaluate(Task) that allows the caller to specify the EvalContext
that should be used within the graph during evaluation. |
<T> EvalContext.Value<T> |
immediateValue(T t)
Create a
EvalContext.Value with semantics defined by this EvalContext |
<T> EvalContext.Promise<T> |
promise()
Create a promise for a value that can be fulfilled somewhere else.
|
<T> EvalContext.Value<T> |
value(Fn<T> t)
Create a
EvalContext.Value with semantics defined by this EvalContext |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
async, currentTask, evaluate, invokeProcessFn, listener, sync
public static EvalContext create(Executor executor)
public <T> EvalContext.Value<T> evaluateInternal(Task<T> task, EvalContext context)
EvalContext
EvalContext.evaluate(Task)
that allows the caller to specify the EvalContext
that should be used within the graph during evaluation.
This is intended to be called from EvalContext
implementations that form a
composition of other contexts.
evaluateInternal
in interface EvalContext
T
- The type of the task resulttask
- The task to evaluatecontext
- The context to use in further evaluationpublic final <T> EvalContext.Value<T> value(Fn<T> t)
EvalContext
EvalContext.Value
with semantics defined by this EvalContext
value
in interface EvalContext
T
- The type of the valuet
- A value value supplierpublic final <T> EvalContext.Value<T> immediateValue(T t)
EvalContext
EvalContext.Value
with semantics defined by this EvalContext
immediateValue
in interface EvalContext
T
- The type of the valuet
- An actual value to wrappublic <T> EvalContext.Promise<T> promise()
EvalContext
promise
in interface EvalContext
T
- The type of the promised valueCopyright © 2020. All rights reserved.