Package org.camunda.bpm.client.backoff
Interface BackoffStrategy
- All Known Subinterfaces:
ErrorAwareBackoffStrategy
- All Known Implementing Classes:
ExponentialBackoffStrategy,ExponentialErrorBackoffStrategy
public interface BackoffStrategy
Provides a way to define a back off between fetch and lock requests.
Note: Since an implementation of this interface may be executed by multiple threads, it is recommended to implement the custom backoff strategy in a thread-safe manner.
- Author:
- Nikola Koevski
-
Method Summary
Modifier and TypeMethodDescriptionlongCalculates the back off time and is invoked afterreconfigure(List).voidreconfigure(List<ExternalTask> externalTasks) Reconfigures the back off strategy based on the fetched external tasks and is invoked beforecalculateBackoffTime().
-
Method Details
-
reconfigure
Reconfigures the back off strategy based on the fetched external tasks and is invoked before
calculateBackoffTime().The implementation might count the amount of invocations and realize a strategy reset.
- Parameters:
externalTasks- which have been fetched
-
calculateBackoffTime
long calculateBackoffTime()Calculates the back off time and is invoked after
reconfigure(List).- Returns:
- the back off time between fetch and lock requests in milliseconds
-