Package com.lmax.disruptor
Class NanosecondPauseBatchRewindStrategy
java.lang.Object
com.lmax.disruptor.NanosecondPauseBatchRewindStrategy
- All Implemented Interfaces:
BatchRewindStrategy
Strategy for handling a rewindableException that will pause for a specified amount of nanos.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNanosecondPauseBatchRewindStrategy(long nanoSecondPauseTime) Strategy for handling a rewindableException that will pause for a specified amount of nanos. -
Method Summary
Modifier and TypeMethodDescriptionhandleRewindException(RewindableException e, int retriesAttempted) When aRewindableExceptionis thrown, this will be called.
-
Field Details
-
nanoSecondPauseTime
private final long nanoSecondPauseTime
-
-
Constructor Details
-
NanosecondPauseBatchRewindStrategy
public NanosecondPauseBatchRewindStrategy(long nanoSecondPauseTime) Strategy for handling a rewindableException that will pause for a specified amount of nanos.
- Parameters:
nanoSecondPauseTime- Amount of nanos to pause for when a rewindable exception is thrown
-
-
Method Details
-
handleRewindException
Description copied from interface:BatchRewindStrategyWhen aRewindableExceptionis thrown, this will be called.- Specified by:
handleRewindExceptionin interfaceBatchRewindStrategy- Parameters:
e- the exception that propagated from theEventHandler.retriesAttempted- how many attempts there have been for the batch- Returns:
- the decision of whether to rewind the batch or throw the exception
-