use of com.hazelcast.simulator.test.StopException in project hazelcast-simulator by hazelcast.
the class ProducerConsumerTest method consume.
@TimeStep(executionGroup = "consumer")
public void consume(ConsumerState state) throws Exception {
Long item = workQueue.take();
if (item.equals(-1L)) {
workQueue.add(item);
throw new StopException();
}
state.consumed++;
Thread.sleep(state.randomInt(maxIntervalMillis));
}
Aggregations