From 62fbfa9965ce92aa1da5faefefa5846b097c70d9 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 28 Oct 2017 02:13:50 +0300 Subject: [PATCH] uasyncio.core: Add yield call to remove coro from scheduling. yield False won't reschedule current coroutine to be run again. This is useful when coro is put on some waiting queue (and is similar to what yield IORead/yield IOWrite do). --- uasyncio.core/uasyncio/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uasyncio.core/uasyncio/core.py b/uasyncio.core/uasyncio/core.py index fcb7bd2b..634f41cf 100644 --- a/uasyncio.core/uasyncio/core.py +++ b/uasyncio.core/uasyncio/core.py @@ -116,6 +116,9 @@ class EventLoop: elif ret is None: # Just reschedule pass + elif ret is False: + # Don't reschedule + continue else: assert False, "Unsupported coroutine yield value: %r (of type %r)" % (ret, type(ret)) except StopIteration as e: