(self)
Shutdown all active asynchronous generators.
Shutdown all active asynchronous generators.
Shutdown all active asynchronous generators .
async def shutdown_asyncgens(self):
        """Shutdown all active asynchronous generators."""
        self._asyncgens_shutdown_called = True

        if not len(self._asyncgens):
            # If Python version is <3.6 or we don't have any asynchronous
            # generators alive.
            return

        closing_agens = list(self._asyncgens)
        self._asyncgens.clear()

        results = await tasks.gather(
            *[ag.aclose() for ag in closing_agens],
            return_exceptions=True)

        for result, agen in zip(results, closing_agens):
            if isinstance(result, Exception):
                self.call_exception_handler({
                    'message': f'an error occurred during closing of '
                               f'asynchronous generator {agen!r}',
                    'exception': result,
                    'asyncgen': agen
                })
async def shutdown_asyncgens ( self ) : self . _asyncgens_shutdown_called = True if not len ( self . _asyncgens ) : # If Python version is <3.6 or we don't have any asynchronous # generators alive. return closing_agens = list ( self . _asyncgens ) self . _asyncgens . clear ( ) results = await tasks . gather ( * [ ag . aclose ( ) for ag in closing_agens ] , return_exceptions = True ) for result , agen in zip ( results , closing_agens ) : if isinstance ( result , Exception ) : self . call_exception_handler ( { 'message' : f'an error occurred during closing of ' f'asynchronous generator {agen!r}' , 'exception' : result , 'asyncgen' : agen } )