Makes sure the asyncio loop is closed.
482345
def _exit_handling(self):
        

        def close_asyncio_loop():
            loop = None
            try:
                loop = asyncio.get_event_loop()
            except AttributeError:
                pass
            if loop is not None:
                loop.close()

        atexit.register(close_asyncio_loop)
355503
def close(self):
        '''
        
        '''
        if self._closed:
            return
        self._closed = True
        self._worker_thread.work_queue.put(self.aiohttp_session.close())
        self._worker_thread.work_queue.put(self.worker_thread.sentinel)
        self._worker_thread.join()
539677
def handle_ConnectionClose(self, frame):
        
        # Notify server we are OK to close.
        self.sender.send_CloseOK()

        exc = ConnectionClosed(frame.payload.reply_text,
                               frame.payload.reply_code)
        self._close_all(exc)
        # This will not abort transport, it will try to flush remaining data
        # asynchronously, as stated in `asyncio` docs.
        self.protocol.close()
1169131
async def close(self) -> None:
        
        self.stream.close()
        # Block until the serving loop is done, but ignore any exceptions
        # (start_serving is already responsible for logging them).
        assert self._serving_future is not None
        try:
            await self._serving_future
        except Exception:
            pass
39254
def close(self):
        '''
        '''
        if self.closed: return
        for func,arglist in self.callbacks:
            apply(func, arglist)
        self.closed = True
800714
def finish(self):
        
        assert self._request, "Request closed"
        self._request_finished = True
        if self.m2req.should_close() or self.no_keep_alive:
            self._send("")
        self._request = None
830761
def close(self):
        
        return self._loop.run_in_executor(self._executor, self._channel.close)
764034
async def close(self):
        
        if self._server:
            self._server.close()
            self._server = None
            self.event('stop').fire()
1338691
def close(self):
        
        self._execute_plugin_hooks_sync(hook='close')

        if not self.session.closed:
            ensure_future(self.session.close(), loop=self.loop)
896009
def run_until_complete(self) -> None:
        ''''''

        Log.debug('running event loop until all tasks completed')
        self.terminate_on_finish = True
        asyncio.ensure_future(self.init())
        self.loop.run_forever()
        self.loop.close()
902954
def _run_sync(self, method: Callable, *args, **kwargs) -> Any:
        
        if self.loop.is_running():
            raise RuntimeError("Event loop is already running.")

        if not self.is_connected:
            self.loop.run_until_complete(self.connect())

        task = asyncio.Task(method(*args, **kwargs), loop=self.loop)
        result = self.loop.run_until_complete(task)

        self.loop.run_until_complete(self.quit())

        return result
175489
def flush_if_ended(self):
		""""""
		if self.ended and self.next and len(self.files) == self.transformed:
			future = asyncio.ensure_future(self.transformer.flush())
			future.add_done_callback(lambda x: self.next.end_of_stream())
1172790
def closed(self):
        """"""
        closed = self._closing or self._closed
        if not closed and self._reader and self._reader.at_eof():
            self._closing = closed = True
            self._loop.call_soon(self._do_close, None)
        return closed
1063003
def close(self):
        '''
        '''
        if not self.closed:
            waiters = []
            queue = self._queue
            while queue.qsize():
                connection = queue.get_nowait()
                if connection:
                    closed = connection.close()
                    if closed:
                        waiters.append(closed)
            in_use = self._in_use_connections
            self._in_use_connections = set()
            for connection in in_use:
                if connection:
                    waiters.append(connection.close())
            self._closed = asyncio.gather(*waiters, loop=self._loop)
        return self._closed
1220834
def close(self):
        
        if self._process:
            # Be nice first.
            self._process.send_signal(signal.SIGINT)

            # If it doesn't close itself promptly, be brutal.
            # Python 3.2+ added the timeout option to wait() and the
            # corresponding TimeoutExpired exception. If they exist, use them.
            if hasattr(subprocess, 'TimeoutExpired'):
                try:
                    self._process.wait(timeout=1)
                except subprocess.TimeoutExpired:
                    self._process.send_signal(signal.SIGKILL)

            # Otherwise, roll our own polling loop.
            else:
                # Give it 1s, checking every 10ms.
                count = 0
                while count < 100:
                    if self._process.poll() is not None:
                        break
                    time.sleep(0.01)

                # Still hasn't quit.
                if self._process.poll() is None:
                    self._process.send_signal(signal.SIGKILL)

            # Clean up.
            self._process = None
962608
async def close(self):
        
        if self._server:
            self._server.close()
            self._server = None
            coro = self._close_connections()
            if coro:
                await coro
            self.logger.debug('%s closed', self)
            self.event('stop').fire()
357570
def wait_stop(self):
        
        if not self.running:
            return
        self.stop()
        try:
            yield from self._task
        except asyncio.CancelledError:
            pass