Package org.apache.camel.util.backoff
Interface BackOffTimer
- All Known Implementing Classes:
SimpleBackOffTimer
public interface BackOffTimer
A simple timer utility that use a linked
BackOff to determine when a task should be executed.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets the name of this timer.getTasks()Access to unmodifiable set of all the tasksvoidremove(BackOffTimer.Task task) Removes the taskschedule(BackOff backOff, ThrowingFunction<BackOffTimer.Task, Boolean, Exception> function) Schedules a task to run according to the backoff settingsintsize()Number of tasks
-
Method Details
-
schedule
BackOffTimer.Task schedule(BackOff backOff, ThrowingFunction<BackOffTimer.Task, Boolean, Exception> function) Schedules a task to run according to the backoff settings- Parameters:
backOff- the settings for how often to run the taskfunction- the function to call for each run- Returns:
- the task
-
getName
Gets the name of this timer. -
remove
Removes the task -
getTasks
Access to unmodifiable set of all the tasks -
size
int size()Number of tasks
-