@Override public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } logger.info("Ownership cache : {} streams cached, {} hosts cached", stream2Addresses.size(), address2Streams.size()); logger.info("Cached streams : {}", stream2Addresses); scheduleDumpOwnershipCache(); }
@Override public void run(Timeout timeout) throws Exception { if (!timeout.isCancelled()) { serviceTimeout.inc(); handleServiceTimeout("Operation " + op.getClass().getName() + " timeout"); } } }, serviceTimeoutMs, TimeUnit.MILLISECONDS);
@Override synchronized public void run(Timeout timeout) throws Exception { if (!timeout.isCancelled() && null != nextAddressToSend) { doSend(nextAddressToSend); } else { fail(null, new CancelledRequestException()); } } }
@Override public void run(Timeout timeout) throws Exception { if (timeout.isCancelled() || closed) { return;
public void run(Timeout timeout) throws Exception { if (timeout.isCancelled() || !ctx.getChannel().isOpen()) { return; } State state = (State) ctx.getAttachment(); long currentTime = System.currentTimeMillis(); long lastIoTime = Math.max(state.lastReadTime, state.lastWriteTime); long nextDelay = allIdleTimeMillis - (currentTime - lastIoTime); if (nextDelay <= 0) { // Both reader and writer are idle - set a new timeout and // notify the callback. state.allIdleTimeout = timer.newTimeout(this, allIdleTimeMillis, TimeUnit.MILLISECONDS); fireChannelIdle(ctx, IdleState.ALL_IDLE, lastIoTime); } else { // Either read or write occurred before the timeout - set a new // timeout with shorter delay. state.allIdleTimeout = timer.newTimeout(this, nextDelay, TimeUnit.MILLISECONDS); } } }
public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } if (!ctx.getChannel().isOpen()) { return; } // Mark the future as failure if (future.setFailure(EXCEPTION)) { // If succeeded to mark as failure, notify the pipeline, too. fireWriteTimeOut(ctx); } }
public void run(Timeout timeout) throws Exception { if (timeout.isCancelled() || !ctx.getChannel().isOpen()) { return; } State state = (State) ctx.getAttachment(); long currentTime = System.currentTimeMillis(); long lastWriteTime = state.lastWriteTime; long nextDelay = writerIdleTimeMillis - (currentTime - lastWriteTime); if (nextDelay <= 0) { // Writer is idle - set a new timeout and notify the callback. state.writerIdleTimeout = timer.newTimeout(this, writerIdleTimeMillis, TimeUnit.MILLISECONDS); fireChannelIdle(ctx, IdleState.WRITER_IDLE, lastWriteTime); } else { // Write occurred before the timeout - set a new timeout with shorter delay. state.writerIdleTimeout = timer.newTimeout(this, nextDelay, TimeUnit.MILLISECONDS); } } }
public void run(Timeout timeout) throws Exception { if (timeout.isCancelled() || !ctx.getChannel().isOpen()) { return; } State state = (State) ctx.getAttachment(); long currentTime = System.currentTimeMillis(); long lastReadTime = state.lastReadTime; long nextDelay = readerIdleTimeMillis - (currentTime - lastReadTime); if (nextDelay <= 0) { // Reader is idle - set a new timeout and notify the callback. state.readerIdleTimeout = timer.newTimeout(this, readerIdleTimeMillis, TimeUnit.MILLISECONDS); fireChannelIdle(ctx, IdleState.READER_IDLE, lastReadTime); } else { // Read occurred before the timeout - set a new timeout with shorter delay. state.readerIdleTimeout = timer.newTimeout(this, nextDelay, TimeUnit.MILLISECONDS); } } }
public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } if (!ctx.getChannel().isOpen()) { return; } State state = (State) ctx.getAttachment(); long currentTime = System.currentTimeMillis(); long nextDelay = timeoutMillis - (currentTime - state.lastReadTime); if (nextDelay <= 0) { // Read timed out - set a new timeout and notify the callback. state.timeout = timer.newTimeout(this, timeoutMillis, TimeUnit.MILLISECONDS); fireReadTimedOut(ctx); } else { // Read occurred before the timeout - set a new timeout with shorter delay. state.timeout = timer.newTimeout(this, nextDelay, TimeUnit.MILLISECONDS); } }
@Override public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } logger.info("Ownership cache : {} streams cached, {} hosts cached", stream2Addresses.size(), address2Streams.size()); logger.info("Cached streams : {}", stream2Addresses); scheduleDumpOwnershipCache(); }
@Override public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } logger.info("Ownership cache : {} streams cached, {} hosts cached", stream2Addresses.size(), address2Streams.size()); logger.info("Cached streams : {}", stream2Addresses); scheduleDumpOwnershipCache(); }
@Override public void run(Timeout timeout) throws Exception { if (!timeout.isCancelled()) { serviceTimeout.inc(); handleServiceTimeout("Operation " + op.getClass().getName() + " timeout"); } } }, serviceTimeoutMs, TimeUnit.MILLISECONDS);
@Override public void run(Timeout timeout) throws Exception { if (stopped || timeout.isCancelled()) { return; } log.trace("Collecting stats for {}", pcepTunnelId); sendTunnelStatistic(); if (!stopped && !timeout.isCancelled()) { log.trace("Scheduling stats collection in {} seconds for {}", this.refreshInterval, pcepTunnelId); timeout.getTimer().newTimeout(this, refreshInterval, TimeUnit.SECONDS); } }
@Override public void run(Timeout to) throws Exception { if (stopped || timeout.isCancelled()) { return; } log.trace("Collecting stats for {}", sw.getStringId()); sendPortStatistic(); if (!stopped && !timeout.isCancelled()) { log.trace("Scheduling stats collection in {} seconds for {}", this.refreshInterval, this.sw.getStringId()); timeout.getTimer().newTimeout(this, refreshInterval, TimeUnit.SECONDS); } }
private void cancelRequestTimeouts(Request request) { Timeout sendTimeout = request.getSendTimeout(); if (sendTimeout != null && !sendTimeout.isCancelled()) { sendTimeout.cancel(); } Timeout receiveTimeout = request.getReceiveTimeout(); if (receiveTimeout != null && !receiveTimeout.isCancelled()) { receiveTimeout.cancel(); } Timeout readTimeout = request.getReadTimeout(); if (readTimeout != null && !readTimeout.isCancelled()) { readTimeout.cancel(); } }
@Override public void run(Timeout timeout) throws Exception { if (!timeout.isCancelled() && channel != null && channel.isWritable()) { logger.debug("Sending heartbeat/ping frame"); channel.write(new PingWebSocketFrame()); scheduleHeartbeatTask(); } } }
@Override synchronized public void run(Timeout timeout) throws Exception { if (!timeout.isCancelled() && null != nextAddressToSend) { doSend(nextAddressToSend); } else { fail(null, new CancelledRequestException()); } } }
@Override public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } logger.debug("Session " + id + " timed out. Closing and destroying..."); SessionHandler.this.close(1002, "Connection interrupted"); service.destroySession(id); } }, service.getSessionTimeout(), TimeUnit.SECONDS);
@Override public synchronized void run(Timeout timeout) throws Exception { if (!timeout.isCancelled() && null != nextAddressToSend) { doSend(nextAddressToSend); } else { fail(null, new CancelledRequestException()); } } }
@Override public void run(Timeout t) throws Exception { if (t.isCancelled()) { return; } if (!ctx.getChannel().isOpen()) { return; } if (!channelHandler.isHandshakeComplete()) { Channels.fireExceptionCaught(ctx, EXCEPTION); } } }