disruptor.handleEventsWith(delayedEventHandler);
final RingBuffer<TestEvent> ringBuffer = disruptor.start();
delayedEventHandler.awaitStart();
final StubPublisher stubPublisher = new StubPublisher(ringBuffer);
try
{
executor.execute(stubPublisher);
assertProducerReaches(stubPublisher, 4, true);
delayedEventHandler.processEvent();
delayedEventHandler.processEvent();
delayedEventHandler.processEvent();
delayedEventHandler.processEvent();
delayedEventHandler.processEvent();
assertProducerReaches(stubPublisher, 5, false);
}
finally
{
stubPublisher.halt();
}
}