Example #1
0
        async def go():
            scheduler = AsyncIOScheduler(loop)
            ran = False

            def action(scheduler, state):
                nonlocal ran
                ran = True

            scheduler.schedule(action)

            await asyncio.sleep(0.1)
            assert ran is True
Example #2
0
        def go():
            scheduler = AsyncIOScheduler(loop)
            ran = False

            def action(scheduler, state):
                nonlocal ran
                ran = True

            scheduler.schedule(action)

            yield from asyncio.sleep(0.1, loop=loop)
            assert ran is True