io.reactivex.netty.protocol.http.client.HttpClient.shutdown()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(149)

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

HttpClient.shutdown介绍

暂无

代码示例

代码示例来源:origin: com.netflix.rxnetty/rx-netty

@Override
public void shutdown() {
  for (HttpClient<I, O> client : httpClients.values()) { // This map also contains the default client, so we don't need to shut the default explicitly.
    client.shutdown();
  }
}

代码示例来源:origin: com.netflix.iep/iep-rxhttp

/**
 * Shutdown all connections that are currently open.
 */
@PreDestroy
public void stop() {
 LOGGER.info("shutting down backround cleanup threads");
 executor.shutdown();
 for (HttpClient<ByteBuf, ByteBuf> client : clients.values()) {
  client.shutdown();
 }
}

代码示例来源:origin: io.reactivex/rxnetty

private HttpClient<I, O> getClient(ServerInfo serverInfo) {
  HttpClient<I, O> client = httpClients.get(serverInfo);
  if (null == client) {
    client = newClient(serverInfo);
    HttpClient<I, O> existing = httpClients.putIfAbsent(serverInfo, client);
    if (null != existing) {
      client.shutdown();
      client = existing;
    }
  }
  return client;
}

代码示例来源:origin: com.netflix.rxnetty/rx-netty

private HttpClient<I, O> getClient(ServerInfo serverInfo) {
  HttpClient<I, O> client = httpClients.get(serverInfo);
  if (null == client) {
    client = newClient(serverInfo);
    HttpClient<I, O> existing = httpClients.putIfAbsent(serverInfo, client);
    if (null != existing) {
      client.shutdown();
      client = existing;
    }
  }
  return client;
}

代码示例来源:origin: io.reactivex/rxnetty

@Override
public void shutdown() {
  super.shutdown();
  for (HttpClient<I, O> client : httpClients.values()) {
    // Constructor adds 'this' as the default client; special-case it to avoid stack overflow.
    if (client != this) {
      client.shutdown();
    }
  }
}

代码示例来源:origin: com.netflix.ribbon/ribbon

@Override
  public synchronized void shutdown() {
    if (!shutdownFlag) {
      httpResourceGroup.getClient().shutdown();
      shutdownFlag = true;
    }
  }
}

代码示例来源:origin: com.netflix.iep/iep-rxhttp

@Override public void run() {
  try {
   LOGGER.debug("executing cleanup for {} clients", clients.size());
   for (Map.Entry<Server, HttpClient<ByteBuf, ByteBuf>> entry : clients.entrySet()) {
    final Server s = entry.getKey();
    if (s.isRegistered() && !serverRegistry.isStillAvailable(s)) {
     LOGGER.debug("cleaning up client for {}", s);
     clients.remove(s);
     entry.getValue().shutdown();
    }
   }
   LOGGER.debug("cleanup complete with {} clients remaining", clients.size());
  } catch (Exception e) {
   LOGGER.warn("connection cleanup task failed", e);
  }
 }
};

代码示例来源:origin: com.netflix.iep/iep-rxhttp

private HttpClient<ByteBuf, ByteBuf> getClient(final RequestContext context) {
 HttpClient<ByteBuf, ByteBuf> c = clients.get(context.server());
 if (c == null) {
  c = newClient(context);
  HttpClient<ByteBuf, ByteBuf> tmp = clients.putIfAbsent(context.server(), c);
  if (tmp != null) {
   c.shutdown();
   c = tmp;
  }
 }
 return c;
}

代码示例来源:origin: com.microsoft.azure/azure-documentdb-rx

@Override
public void close() {
  this.safeShutdownExecutorService(this.collectionCacheExecutorService);
  this.safeShutdownExecutorService(this.computationExecutor);
  try {
    this.rxWrapperClient.close();
  } catch (Exception e) {
    logger.warn("Failure in shutting down rxWrapperClient", e);
  }
  try {
    this.rxClient.shutdown();
  } catch (Exception e) {
    logger.warn("Failure in shutting down rxClient", e);
  }
}

相关文章