Strategy employed for making EventProcessors wait on a cursor Sequence.
| 20 | * Strategy employed for making {@link EventProcessor}s wait on a cursor {@link Sequence}. |
| 21 | */ |
| 22 | public interface WaitStrategy |
| 23 | { |
| 24 | /** |
| 25 | * Wait for the given sequence to be available. It is possible for this method to return a value |
| 26 | * less than the sequence number supplied depending on the implementation of the WaitStrategy. A common |
| 27 | * use for this is to signal a timeout. Any EventProcessor that is using a WaitStrategy to get notifications |
| 28 | * about message becoming available should remember to handle this case. The {@link BatchEventProcessor} explicitly |
| 29 | * handles this case and will signal a timeout if required. |
| 30 | * |
| 31 | * @param sequence to be waited on. |
| 32 | * @param cursor the main sequence from ringbuffer. Wait/notify strategies will |
| 33 | * need this as it's the only sequence that is also notified upon update. |
| 34 | * @param dependentSequence on which to wait. |
| 35 | * @param barrier the processor is waiting on. |
| 36 | * @return the sequence that is available which may be greater than the requested sequence. |
| 37 | * @throws AlertException if the status of the Disruptor has changed. |
| 38 | * @throws InterruptedException if the thread is interrupted. |
| 39 | * @throws TimeoutException if a timeout occurs before waiting completes (not used by some strategies) |
| 40 | */ |
| 41 | long waitFor(long sequence, Sequence cursor, Sequence dependentSequence, SequenceBarrier barrier) |
| 42 | throws AlertException, InterruptedException, TimeoutException; |
| 43 | |
| 44 | /** |
| 45 | * Implementations should signal the waiting {@link EventProcessor}s that the cursor has advanced. |
| 46 | */ |
| 47 | void signalAllWhenBlocking(); |
| 48 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…