public abstract class ForwardingEvalContext extends Object implements EvalContext
EvalContext
that forwards calls.EvalContext.Promise<T>, EvalContext.Value<T>
Modifier and Type | Field and Description |
---|---|
protected EvalContext |
delegate |
LOG
Modifier | Constructor and Description |
---|---|
protected |
ForwardingEvalContext(EvalContext delegate) |
Modifier and Type | Method and Description |
---|---|
<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 value)
Create a
EvalContext.Value with semantics defined by this EvalContext |
<T> EvalContext.Value<T> |
invokeProcessFn(TaskId taskId,
Fn<T> processFn)
Invoke the process function of a task.
|
TaskOperator.Listener |
listener()
Used to report task metadata.
|
<T> EvalContext.Promise<T> |
promise()
Create a promise for a value that can be fulfilled somewhere else.
|
<T> EvalContext.Value<T> |
value(Fn<T> value)
Create a
EvalContext.Value with semantics defined by this EvalContext |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
async, currentTask, evaluate, sync
protected final EvalContext delegate
protected ForwardingEvalContext(EvalContext delegate)
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 <T> EvalContext.Value<T> invokeProcessFn(TaskId taskId, Fn<T> processFn)
EvalContext
This method will be called when the process function of a task is ready to be invoked. This
gives this EvalContext
the responsibility of invoking user code. By overriding this
method, one can intercept the evaluation flow just at the moment between inputs being ready
and when the user supplied function for task processing is being invoked.
The default implementation will simply invoke the function immediately inside a
EvalContext.Value
created by EvalContext.value(Fn)
.
invokeProcessFn
in interface EvalContext
T
- The task value typetaskId
- The id of the task being invokedprocessFn
- A lazily evaluated handle to the process functionpublic <T> EvalContext.Value<T> value(Fn<T> value)
EvalContext
EvalContext.Value
with semantics defined by this EvalContext
value
in interface EvalContext
T
- The type of the valuevalue
- A value value supplierpublic <T> EvalContext.Value<T> immediateValue(T value)
EvalContext
EvalContext.Value
with semantics defined by this EvalContext
immediateValue
in interface EvalContext
T
- The type of the valuevalue
- An actual value to wrappublic <T> EvalContext.Promise<T> promise()
EvalContext
promise
in interface EvalContext
T
- The type of the promised valuepublic TaskOperator.Listener listener()
EvalContext
listener
in interface EvalContext
Copyright © 2020. All rights reserved.