當前位置: 首頁>>代碼示例>>Java>>正文


Java Timeout.isCancelled方法代碼示例

本文整理匯總了Java中io.netty.util.Timeout.isCancelled方法的典型用法代碼示例。如果您正苦於以下問題:Java Timeout.isCancelled方法的具體用法?Java Timeout.isCancelled怎麽用?Java Timeout.isCancelled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.netty.util.Timeout的用法示例。


在下文中一共展示了Timeout.isCancelled方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
    if (timeout.isCancelled()) {
        return;
    }
    if (log.isDebugEnabled()) {
        log.debug("[{}] [{}] Batching the messages from the batch container from timer thread", topic,
                producerName);
    }
    // semaphore acquired when message was enqueued to container
    synchronized (ProducerImpl.this) {
        batchMessageAndSend();
    }
    // schedule the next batch message task
    client.timer().newTimeout(this, conf.getBatchingMaxPublishDelayMs(), TimeUnit.MILLISECONDS);
}
 
開發者ID:apache,項目名稱:incubator-pulsar,代碼行數:17,代碼來源:ProducerImpl.java

示例2: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
    log.debug("Timeout occured for Session {}", id);
    //Notify the listener that timeout has occured
    final SessionValue session = sessionManager.getSession(id);

    //Do not proceed if the session is null
    if (session == null) {
        log.error("could not find session value for id {}. Registry Size : {}", id, sessionManager.getSessionEntries().size());
        return;
    }

    //Check first if the promise has been completed
    if (session.getClientPromise() != null && !session.getClientPromise().isDone() && !session.getClientPromise().isCancelled() && !timeout.isCancelled()) {
        //Send a ReadTimeoutException to the client
        session.getClientPromise().completeExceptionally(new ReadTimeoutException(id, String.format("Timeout occured for '%s' Started: %f seconds ago", id, ((double) Duration.ofMillis(System.currentTimeMillis() - session.getTimeRegistered()).toMillis() / 1000.0))));
    }
}
 
開發者ID:ribasco,項目名稱:async-gamequery-lib,代碼行數:19,代碼來源:ReadRequestTimeoutTimerTask.java

示例3: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
    if (timeout.isCancelled()) {
        return;
    }

    if (!ctx.channel().isOpen()) {
        return;
    }
    if (!handler.isClientConnection && 
        ((handler.remoteNode == null ||
         !handler.rpcService.isConnected(handler.remoteNode.
                                         getNodeId()))))
        ctx.fireExceptionCaught(EXCEPTION);
}
 
開發者ID:xuraylei,項目名稱:fresco_floodlight,代碼行數:16,代碼來源:HandshakeTimeoutHandler.java

示例4: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
    if (timeout.isCancelled()) {
        return;
    }

    if (!ctx.channel().isOpen()) {
        return;
    }
    ctx.channel().disconnect();
}
 
開發者ID:xuraylei,項目名稱:fresco_floodlight,代碼行數:12,代碼來源:BootstrapTimeoutHandler.java

示例5: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
    if (timeout.isCancelled()) {
        return;
    }

    if (!ctx.channel().isOpen()) {
        return;
    }
    if (channelHandler.syncManager.ready == false)
        ctx.channel().disconnect();
}
 
開發者ID:xuraylei,項目名稱:fresco_floodlight,代碼行數:13,代碼來源:RSHandshakeTimeoutHandler.java

示例6: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
    if (!timeout.isCancelled()) {
        log.warn("App handshake plugin for {} timed out. Returning result {}.",
                 sw, defaultResult);
        exitPlugin(defaultResult);
    }
}
 
開發者ID:xuraylei,項目名稱:fresco_floodlight,代碼行數:9,代碼來源:OFSwitchAppHandshakePlugin.java

示例7: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout timeout) throws Exception {
    if (timeout.isCancelled()) {
        return;
    }

    if (!ctx.channel().isOpen()) {
        return;
    }
    if (!handshakeHandler.isSwitchHandshakeComplete())
        ctx.fireExceptionCaught(EXCEPTION);
}
 
開發者ID:xuraylei,項目名稱:fresco_floodlight,代碼行數:13,代碼來源:HandshakeTimeoutHandler.java

示例8: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@Override
public void run(Timeout to) {
    if (!devices.isEmpty() && !to.isCancelled() && delay > 0) {
        sendEvent(devices.get(Math.min(currentDevice, devices.size() - 1)));
        currentDevice = (currentDevice + 1) % devices.size();
        timeout = to.timer().newTimeout(to.task(), delay, TimeUnit.MILLISECONDS);
    }
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:9,代碼來源:NullPacketProvider.java

示例9: run

import io.netty.util.Timeout; //導入方法依賴的package包/類
@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.timer().newTimeout(this, refreshInterval, TimeUnit.SECONDS);
    }

}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:16,代碼來源:TunnelStatsCollector.java


注:本文中的io.netty.util.Timeout.isCancelled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。