-
public interface SequenceBarrierCoordination barrier for tracking the cursor for publishers and sequence of dependentEventProcessors for processing a data structure
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidalert()Alert theEventProcessors of a status change and stay in this status until cleared.voidcheckAlert()Check if an alert has been raised and throw anAlertExceptionif it has.voidclearAlert()Clear the current alert status.longgetCursor()Get the current cursor value that can be read.booleanisAlerted()The current alert status for the barrier.longwaitFor(long sequence)Wait for the given sequence to be available for consumption.
-
-
-
Method Detail
-
waitFor
long waitFor(long sequence) throws AlertException, java.lang.InterruptedException, TimeoutExceptionWait for the given sequence to be available for consumption.- Parameters:
sequence- to wait for- Returns:
- the sequence up to which is available
- Throws:
AlertException- if a status change has occurred for the Disruptorjava.lang.InterruptedException- if the thread needs awaking on a condition variable.TimeoutException- if a timeout occurs while waiting for the supplied sequence.
-
getCursor
long getCursor()
Get the current cursor value that can be read.- Returns:
- value of the cursor for entries that have been published.
-
isAlerted
boolean isAlerted()
The current alert status for the barrier.- Returns:
- true if in alert otherwise false.
-
alert
void alert()
Alert theEventProcessors of a status change and stay in this status until cleared.
-
clearAlert
void clearAlert()
Clear the current alert status.
-
checkAlert
void checkAlert() throws AlertExceptionCheck if an alert has been raised and throw anAlertExceptionif it has.- Throws:
AlertException- if alert has been raised.
-
-