Skip to content

Commit 62fbfa9

Browse files
committed
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).
1 parent 8f08257 commit 62fbfa9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

uasyncio.core/uasyncio/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ def run_forever(self):
116116
elif ret is None:
117117
# Just reschedule
118118
pass
119+
elif ret is False:
120+
# Don't reschedule
121+
continue
119122
else:
120123
assert False, "Unsupported coroutine yield value: %r (of type %r)" % (ret, type(ret))
121124
except StopIteration as e:

0 commit comments

Comments
 (0)