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.
Modifier and Type | Method and Description |
---|---|
long |
calculateBackoffTime()
Calculates the back off time and is invoked after
reconfigure(List) . |
void |
reconfigure(List<ExternalTask> externalTasks)
Reconfigures the back off strategy based on the fetched external tasks and is invoked
before
calculateBackoffTime() . |
void reconfigure(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.
externalTasks
- which have been fetchedlong calculateBackoffTime()
Calculates the back off time and is invoked after reconfigure(List)
.
Copyright © 2022. All rights reserved.