Manually shutdown the async API.

    Cancels all related tasks and all the socket transportation.
425279
def shutdown():
    
    global handler, transport, protocol
    if handler is not None:
        handler.close()
        transport.close()
        handler = None
        transport = None
        protocol = None
566283
@Override
    public void close() throws IOException {
        logger.debug("Gracefully stopping Sentry tasks.");
        closed = true;
        actualConnection.close();
        APP_ENGINE_ASYNC_CONNECTIONS.remove(id);
    }
160733
public void close() {
        if (running) {
            taskPool.clear();
            running = false;
            for (PoolThread thread : threadPool) {
                thread.interrupt();
            }
        }
    }
522525
def stop(self):
        
        try:
            self.running = False
            logger.info('Waiting tasks to finish...')
            self.queue.join()
            self.socket.close()
            logger.info('Exiting (C-Ctrl again to force it)...')
        except KeyboardInterrupt:
            logger.info('Forced.')
            sys.exit(1)
121303
def stop(self):
        """"""
        if self._thread:
            _LOGGER.info("Stopping SocketIO thread...")

            # pylint: disable=W0212
            self._running = False

            if self._exit_event:
                self._exit_event.set()

            self._thread.join()
55173
def shutdown(self):
        '''
        
        '''
        for item in self.clients:
            client, address = item
            client.close()
            self.clients.remove(item)
921625
def shutdown(self):
        
        task = asyncio.ensure_future(self.core.shutdown())
        self.loop.run_until_complete(task)
266690
public void shutDown() {
		vectorizationExecutor.shutdown(); // Disable new tasks from being submitted
		try {
			// Wait a while for existing tasks to terminate
			if (!vectorizationExecutor.awaitTermination(10, TimeUnit.SECONDS)) {
				vectorizationExecutor.shutdownNow(); // Cancel currently executing tasks
				// Wait a while for tasks to respond to being cancelled
				if (!vectorizationExecutor.awaitTermination(10, TimeUnit.SECONDS))
					System.err.println("Pool did not terminate");
			}
		} catch (InterruptedException ie) {
			// (Re-)Cancel if current thread also interrupted
			vectorizationExecutor.shutdownNow();
			// Preserve interrupt status
			Thread.currentThread().interrupt();
		}
	}
847093
async def terminate(self) -> None:
        """"""
        await asyncio.sleep(config.shutdown_wait)
        # stop server and close loop if no more connection exists
        if not is_connected():
            stop_server(self.application.server)
            self.application.loop.stop()
171085
public synchronized void shutdown() {
        if (stopLock.get())
            return;


        // shutting down underlying transport
        transport.shutdown();

        // disposing INDArray flow
        disposable.dispose();

        updaterParamsSubscribers.clear();
        modelParamsSubsribers.clear();
        updatesSubscribers.clear();
        updatesQueue.clear();

        // state that we're done
        launchLock.set(false);

        stopLock.set(true);
    }
764034
async def close(self):
        
        if self._server:
            self._server.close()
            self._server = None
            self.event('stop').fire()
249056
protected void shutdownOutput() throws IOException {
      if (fd != null && fd.valid()) {
          socketShutdown(SHUT_WR);
          shut_wr = true;
      }
    }
727582
def shutdown(self):
        
        # Remove reference to inputQueue (raises exception if inputQueue is used after method call)
        inputQueue = self.inputQueue
        self.inputQueue = None
        for i in range(self.numWorkers):
            inputQueue.put(None)
        for thread in self.workerThreads:
            thread.join()
        BatchSystemSupport.workerCleanup(self.workerCleanupInfo)
1070702
async def stop_async(self):
        
        self.cancellation_token.cancel()
        if self.run_task and not self.run_task.done():
            await self.run_task
484630
public void shutdown() {
        final Connection connection;
        synchronized (this) {
            if(shutdown) return;
            shutdown = true;
            connection = this.connection;
            if(connectTask != null) {
                connectTask.shutdown();
            }
        }
        if (connection != null) {
            connection.closeAsync();
        }
    }
670189
def shutdown(self, payload=None):
        
        logging.info("Work queue shutdown.")
        self.connection.close()
        self.receiving_messages = False
233026
public synchronized void shutdown() {
    
    LOG.info("Shutting down all AsyncDiskService threads...");
    
    for (Map.Entry<String, ThreadPoolExecutor> e
        : executors.entrySet()) {
      e.getValue().shutdown();
    }
  }