@Override public boolean isDestroyed() { return client.isClosed(); } }
public boolean isClosed() { return closed || client.isClosed(); }
public void close() { if (closeClient && !client.isClosed()) { try { client.close(); } catch (IOException e) { logger.warn("Unexpected error on client close", e); } } closed = true; }
public void close() { logger.info("Slack RTM closing..."); stop = true; if (webSocket != null && webSocket.isOpen()) { webSocket.sendCloseFrame(); } if (asyncHttpClient != null && !asyncHttpClient.isClosed()) { try { asyncHttpClient.close(); } catch (IOException e) { // ignore } } logger.info("Slack RTM closed."); }
public final void destroy() { this.healthyHosts.getAndUpdate(healthyHosts -> { final List<HostMetaData> hosts = healthyHosts.getHosts(); final List<HostMetaData> killHosts = new ArrayList<>(hosts); killHosts.clear(); return HealthyHosts.empty(); }); if (!getClient().isClosed()) { try { getClient().close(); } catch (final RuntimeException | IOException e) { throw new IllegalStateException("Could not destroy the AsyncHttpClient", e); } } destroyed = true; }