How to use the aiorun._DO_NOT_CANCEL_COROS function in aiorun

To help you get started, we’ve selected a few aiorun examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cjrh / aiorun / tests / test_posix.py View on Github external
def direct_cancel():
        """Reach inside, find the one task that is marked "do not cancel"
        for shutdown, and then cancel it directly. This should raise
        CancelledError at the location of the caller for
        `shutdown_waits_for()`."""
        tasks = all_tasks()
        for t in tasks:  # pragma: no cover
            if t._coro in _DO_NOT_CANCEL_COROS:
                t.cancel()
                return

aiorun

Boilerplate for asyncio applications

Apache-2.0
Latest version published 13 days ago

Package Health Score

76 / 100
Full package analysis