Interface LambdaGovernor
- All Known Implementing Classes:
BatchedLambdaGovernor
public interface LambdaGovernor
Schedules and executes
Runnable tasks.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener to handle errors from events within a scheduled job.Get the callbacks for a given task.voidpause()Pauses this governor's execution schedule.voidRemove an error listener.voidSchedules when thetaskwill run.voidschedule(Object key, Runnable task, RunnableFuture callback) Schedules when thetaskwill run.voidshutDown()Shuts down this governor.voidstart()Starts this governor's execution schedule.
-
Method Details
-
start
void start()Starts this governor's execution schedule. -
pause
void pause()Pauses this governor's execution schedule. Tasks can still be added to the work queue. -
shutDown
void shutDown()Shuts down this governor. Tasks can no longer be added to the work queue. The currently running task will be allowed to execute until completion. This LambdaGovernor can not be restarted once shutDown is called. -
schedule
Schedules when thetaskwill run.- Parameters:
key-taskidentifiertask-Runnabletask
-
schedule
Schedules when thetaskwill run. Adds thecallbackfor the given key -
getAndClearCallbacks
Get the callbacks for a given task. Allows all callbacks to run after governor choking.- Parameters:
key- task identifier- Returns:
- callbacks for the given key.
-
addErrorListener
Add a listener to handle errors from events within a scheduled job.- Parameters:
l- the listener to add
-
removeErrorListener
Remove an error listener.- Parameters:
l- the listener to remove
-