io.netty.util.Timer.stop()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中io.netty.util.Timer.stop()方法的一些代码示例,展示了Timer.stop()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Timer.stop()方法的具体详情如下:
包路径:io.netty.util.Timer
类名称:Timer
方法名:stop

Timer.stop介绍

[英]Releases all resources acquired by this Timer and cancels all tasks which were scheduled but not executed yet.
[中]释放此计时器获取的所有资源,并取消所有已计划但尚未执行的任务。

代码示例

代码示例来源:origin: traccar/traccar

public static void release() {
  if (instance != null) {
    instance.stop();
  }
  instance = null;
}

代码示例来源:origin: AsyncHttpClient/async-http-client

@Override
public void close() {
 if (closed.compareAndSet(false, true)) {
  try {
   channelManager.close();
  } catch (Throwable t) {
   LOGGER.warn("Unexpected error on ChannelManager close", t);
  }
  if (allowStopNettyTimer) {
   try {
    nettyTimer.stop();
   } catch (Throwable t) {
    LOGGER.warn("Unexpected error on HashedWheelTimer close", t);
   }
  }
 }
}

代码示例来源:origin: mpusher/mpush

@Override
  protected void doStop(Listener listener) throws Throwable {
    pool.close();
    workerGroup.shutdownGracefully();
    timer.stop();
    listener.onSuccess();
  }
}

代码示例来源:origin: apache/pulsar

@Override
public void shutdown() throws PulsarClientException {
  try {
    lookup.close();
    cnxPool.close();
    timer.stop();
    externalExecutorProvider.shutdownNow();
    conf.getAuthentication().close();
  } catch (Throwable t) {
    log.warn("Failed to shutdown Pulsar client", t);
    throw new PulsarClientException(t);
  }
}

代码示例来源:origin: apache/incubator-pinot

_timer.stop();
LOGGER.info("Timer shut down !!");

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

/**
  * Hook invoked when the cluster is shutting down after a call to {@link Cluster#close()}.
  *
  * <p>This is guaranteed to be called only after all connections have been individually closed,
  * and their channels closed, and only once per {@link Timer} instance.
  *
  * <p>This gives the implementor a chance to close the {@link Timer} properly, if required.
  *
  * <p>The default implementation calls a {@link Timer#stop()} of the passed {@link Timer}
  * instance.
  *
  * <p>Implementation note: if the {@link Timer} instance is being shared, or used for other
  * purposes than to schedule actions for the current cluster, than it should not be stopped here;
  * subclasses would have to override this method accordingly to take the appropriate action.
  *
  * @param timer the timer used by the cluster being closed
  */
 public void onClusterClose(Timer timer) {
  timer.stop();
 }
}

代码示例来源:origin: lettuce-io/lettuce-core

timer.stop();

代码示例来源:origin: com.baidu/brpc-java

@Override
public void destroy() {
  if (timer != null) {
    timer.stop();
  }
}

代码示例来源:origin: baidu/brpc-java

@Override
public void destroy() {
  if (timer != null) {
    timer.stop();
  }
}

代码示例来源:origin: baidu/brpc-java

@Override
public void unsubscribe(SubscribeInfo subscribeInfo) {
  namingServiceTimer.stop();
}

代码示例来源:origin: com.baidu/brpc-java

@Override
public void unsubscribe(RegisterInfo registerInfo) {
  namingServiceTimer.stop();
}

代码示例来源:origin: opendaylight/controller

@Override
public Set<Timeout> stop() {
  return this.timer.stop();
}

代码示例来源:origin: baidu/brpc-java

@Override
public void unsubscribe(SubscribeInfo subscribeInfo) {
  namingServiceTimer.stop();
}

代码示例来源:origin: org.opendaylight.controller/netty-timer-config

@Override
public Set<Timeout> stop() {
  return this.timer.stop();
}

代码示例来源:origin: org.asynchttpclient/async-http-client-netty4-provider

@Override
public void close() {
  if (closed.compareAndSet(false, true)) {
    try {
      channelManager.close();
      if (allowStopNettyTimer)
        nettyTimer.stop();
    } catch (Throwable t) {
      LOGGER.warn("Unexpected error on close", t);
    }
  }
}

代码示例来源:origin: msemys/esjc

@Override
public void shutdown() {
  timer.stop();
  client.close();
}

代码示例来源:origin: com.github.msemys/esjc

@Override
public void shutdown() {
  timer.stop();
  client.close();
}

代码示例来源:origin: org.asynchttpclient/async-http-client-netty4

@Override
public void close() {
  if (closed.compareAndSet(false, true)) {
    try {
      channelManager.close();
      if (allowStopNettyTimer)
        nettyTimer.stop();
    } catch (Throwable t) {
      LOGGER.warn("Unexpected error on close", t);
    }
  }
}

代码示例来源:origin: org.apache.pulsar/pulsar-client-original

@Override
public void shutdown() throws PulsarClientException {
  try {
    lookup.close();
    cnxPool.close();
    timer.stop();
    externalExecutorProvider.shutdownNow();
    conf.getAuthentication().close();
  } catch (Throwable t) {
    log.warn("Failed to shutdown Pulsar client", t);
    throw new PulsarClientException(t);
  }
}

代码示例来源:origin: bigpuritz/netty-servlet-bridge

public void shutdown() {
  this.watchdog.stopWatching();
  ServletBridgeWebapp.get().destroy();
  this.timer.stop();
  this.allChannels.close().awaitUninterruptibly();
}

相关文章

微信公众号

最新文章

更多