/** * <p>Waits until all events currently in the disruptor have been processed by all event processors * and then halts the processors.</p> * * <p>This method will not shutdown the executor, nor will it await the final termination of the * processor threads.</p> * * @param timeout the amount of time to wait for all events to be processed. <code>-1</code> will give an infinite timeout * @param timeUnit the unit the timeOut is specified in * @throws TimeoutException if a timeout occurs before shutdown completes. */ public void shutdown(final long timeout, final TimeUnit timeUnit) throws TimeoutException { final long timeOutAt = System.currentTimeMillis() + timeUnit.toMillis(timeout); while (hasBacklog()) { if (timeout >= 0 && System.currentTimeMillis() > timeOutAt) { throw TimeoutException.INSTANCE; } // Busy spin } halt(); }
/** * <p>Waits until all events currently in the disruptor have been processed by all event processors * and then halts the processors.</p> * * <p>This method will not shutdown the executor, nor will it await the final termination of the * processor threads.</p> * * @param timeout the amount of time to wait for all events to be processed. <code>-1</code> will give an infinite timeout * @param timeUnit the unit the timeOut is specified in * @throws TimeoutException if a timeout occurs before shutdown completes. */ public void shutdown(final long timeout, final TimeUnit timeUnit) throws TimeoutException { final long timeOutAt = System.currentTimeMillis() + timeUnit.toMillis(timeout); while (hasBacklog()) { if (timeout >= 0 && System.currentTimeMillis() > timeOutAt) { throw TimeoutException.INSTANCE; } // Busy spin } halt(); }
/** * <p>Waits until all events currently in the disruptor have been processed by all event processors * and then halts the processors.</p> * <p> * <p>This method will not shutdown the executor, nor will it await the final termination of the * processor threads.</p> * * @param timeout the amount of time to wait for all events to be processed. <code>-1</code> will give an infinite timeout * @param timeUnit the unit the timeOut is specified in */ public void shutdown(final long timeout, final TimeUnit timeUnit) throws TimeoutException { final long timeOutAt = System.currentTimeMillis() + timeUnit.toMillis(timeout); while (hasBacklog()) { if (timeout >= 0 && System.currentTimeMillis() > timeOutAt) { throw TimeoutException.INSTANCE; } // Busy spin } halt(); }
/** * <p>Waits until all events currently in the com.lmax.disruptor have been processed by all event processors * and then halts the processors.</p> * * <p>This method will not shutdown the executor, nor will it await the final termination of the * processor threads.</p> * * @param timeout the amount of time to wait for all events to be processed. <code>-1</code> will give an infinite timeout * @param timeUnit the unit the timeOut is specified in * @throws TimeoutException if a timeout occurs before shutdown completes. */ public void shutdown(final long timeout, final TimeUnit timeUnit) throws TimeoutException { final long timeOutAt = System.currentTimeMillis() + timeUnit.toMillis(timeout); while (hasBacklog()) { if (timeout >= 0 && System.currentTimeMillis() > timeOutAt) { throw TimeoutException.INSTANCE; } // Busy spin } halt(); }
/** * <p>Waits until all events currently in the disruptor have been processed by all event processors * and then halts the processors.</p> * * <p>This method will not shutdown the executor, nor will it await the final termination of the * processor threads.</p> * * @param timeout the amount of time to wait for all events to be processed. <code>-1</code> will give an infinite timeout * @param timeUnit the unit the timeOut is specified in */ public void shutdown(final long timeout, final TimeUnit timeUnit) throws TimeoutException { long timeOutAt = System.currentTimeMillis() + timeUnit.toMillis(timeout); while (hasBacklog()) { if (timeout >= 0 && System.currentTimeMillis() > timeOutAt) { throw TimeoutException.INSTANCE; } // Busy spin } halt(); }