(self)
Shutdown the invoker and cancel any currently running tasks

        The shutdown procedure will stop any new tasks being created
        then shutdown all existing tasks
Shutdown the invoker and cancel any currently running tasks
Shutdown the invoker and cancel any currently running tasks
async def close(self):
        """Shutdown the invoker and cancel any currently running tasks

        The shutdown procedure will stop any new tasks being created
        then shutdown all existing tasks
        """
        # Stop consuming commands from the queue
        # (this will also stop *new* tasks being created)
        if self._consumer_task is not None:
            await cancel(self._consumer_task)
            self._consumer_task = None
            self._ready = asyncio.Event()

        # Now we have stopped consuming commands we can
        # cancel any running tasks safe in the knowledge that
        # no new tasks will get created
        await cancel(*self._running_commands)
async def close ( self ) : # Stop consuming commands from the queue # (this will also stop *new* tasks being created) if self . _consumer_task is not None : await cancel ( self . _consumer_task ) self . _consumer_task = None self . _ready = asyncio . Event ( ) # Now we have stopped consuming commands we can # cancel any running tasks safe in the knowledge that # no new tasks will get created await cancel ( * self . _running_commands )