Package dev.getelements.elements.rt
Interface SchedulerContext
- All Known Implementing Classes:
SimpleSchedulerContext,TransactionalSchedulerContext
public interface SchedulerContext
This is the
Proxyable for scheduling tasks within the cluster.-
Method Summary
Modifier and TypeMethodDescriptionvoidResumes the supplied task with theTaskIdsupplying multiple results to the destination.voidresumeFromNetwork(TaskId taskId, Object result) Resumes a task that was waiting on a network call.voidresumeTaskAfterDelay(TaskId taskId, long time, TimeUnit timeUnit) Resumes the task associated with the suppliedTaskId.voidresumeWithError(TaskId taskId, Throwable throwable) Resumes a task that was waiting for any reason.default voidstart()Starts thisSchedulerContext.default voidstop()Stops thisSchedulerContext.
-
Method Details
-
start
default void start()Starts thisSchedulerContext. -
stop
default void stop()Stops thisSchedulerContext. -
resumeTaskAfterDelay
Resumes the task associated with the suppliedTaskId. This allows for the specification of a delay after a specified period of time. -
resume
Resumes the supplied task with theTaskIdsupplying multiple results to the destination.- Parameters:
taskId- theTaskIdof the supplied taskresults- zero or more results from resuming the task
-
resumeFromNetwork
Resumes a task that was waiting on a network call.- Parameters:
taskId- the uniqueTaskIdassociated with the networkresult- the result of the network operation, passed to the task
-
resumeWithError
Resumes a task that was waiting for any reason. This is used to hand an error to the running task in order to a task waiting on an operation.- Parameters:
taskId- the uniqueTaskIdassociated with the networkthrowable- the error in the blocked operation
-