示例#1
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 == True)
示例#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)
示例#3
0
        def go():
            scheduler = AsyncIOScheduler(loop)

            ran = [False]

            def action(scheduler, state):
                ran[0] = True

            scheduler.schedule(action)

            yield From(asyncio.sleep(0.1, loop=loop))
            assert(ran[0] is True)
示例#4
0
        def go():
            scheduler = AsyncIOScheduler(loop)

            ran = [False]

            def action(scheduler, state):
                ran[0] = True

            scheduler.schedule(action)

            yield From(asyncio.sleep(0.1, loop=loop))
            assert (ran[0] is True)