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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
calculateBackoffTime()
Calculates the back off time and is invoked afterreconfigure(List)
.void
reconfigure(java.util.List<ExternalTask> externalTasks)
Reconfigures the back off strategy based on the fetched external tasks and is invoked beforecalculateBackoffTime()
.
-
-
-
Method Detail
-
reconfigure
void reconfigure(java.util.List<ExternalTask> externalTasks)
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
-
-