Interface JobScheduler.IterateResumeAction<CONTEXT_TYPE extends JobScheduler.JobThreadContext>
- Enclosing interface:
- JobScheduler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface JobScheduler.IterateResumeAction<CONTEXT_TYPE extends JobScheduler.JobThreadContext>
Helper interface for
JobScheduler.iterateSerial(io.deephaven.engine.context.ExecutionContext, io.deephaven.base.log.LogOutputAppendable, java.util.function.Supplier<CONTEXT_TYPE>, int, int, io.deephaven.engine.table.impl.util.JobScheduler.IterateResumeAction<CONTEXT_TYPE>, java.lang.Runnable, java.util.function.Consumer<java.lang.Exception>)
and JobScheduler.iterateParallel(io.deephaven.engine.context.ExecutionContext, io.deephaven.base.log.LogOutputAppendable, java.util.function.Supplier<CONTEXT_TYPE>, int, int, io.deephaven.engine.table.impl.util.JobScheduler.IterateAction<CONTEXT_TYPE>, java.lang.Runnable, java.util.function.Consumer<java.lang.Exception>)
. This provides a functional interface
with index
indicating which iteration to perform and resume
providing a mechanism to
inform the scheduler that the current task is complete. When resume
is called, the scheduler will
automatically schedule the next iteration.
NOTE: failing to call resume
will result in the scheduler not scheduling all remaining iterations. This
will not block the scheduler, but the completeAction
Runnable
will never be called.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
run
(CONTEXT_TYPE taskThreadContext, int index, Consumer<Exception> nestedErrorConsumer, Runnable resume) Iteration action to be invoked.
-
Method Details
-
run
void run(CONTEXT_TYPE taskThreadContext, int index, Consumer<Exception> nestedErrorConsumer, Runnable resume) Iteration action to be invoked.- Parameters:
taskThreadContext
- The context, unique to this task-threadindex
- The iteration numbernestedErrorConsumer
- A consumer to pass to directly-nested iterative jobsresume
- A function to call to move on to the next iteration
-