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 TypeMethodDescriptionvoid
Resumes the supplied task with theTaskId
supplying multiple results to the destination.void
resumeFromNetwork
(TaskId taskId, Object result) Resumes a task that was waiting on a network call.void
resumeTaskAfterDelay
(TaskId taskId, long time, TimeUnit timeUnit) Resumes the task associated with the suppliedTaskId
.void
resumeWithError
(TaskId taskId, Throwable throwable) Resumes a task that was waiting for any reason.default void
start()
Starts thisSchedulerContext
.default void
stop()
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 theTaskId
supplying multiple results to the destination.- Parameters:
taskId
- theTaskId
of 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 uniqueTaskId
associated 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 uniqueTaskId
associated with the networkthrowable
- the error in the blocked operation
-