File tree 2 files changed +13
-10
lines changed 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,18 @@ This version has the following features:
18
18
is called with a generator function
19
19
[ PR292] ( https://github.com/micropython/micropython-lib/pull/292 ) . This traps
20
20
a common coding error which otherwise results in silent failure.
21
- * The version and the presence of an event loop instance can be tested at
22
- runtime.
21
+ * The presence of the ` fast_io ` version can be tested at runtime.
22
+ * The presence of an event loop instance can be tested at runtime.
23
+ * ` run_until_complete(coro()) ` now returns the value returned by ` coro() ` as
24
+ per CPython
25
+ [ micropython-lib PR270] ( https://github.com/micropython/micropython-lib/pull/270 ) .
23
26
24
27
Note that priority device drivers are written by using the officially supported
25
- technique for writing stream I/O drivers. If official ` uasyncio ` acquires a
26
- means of prioritising I/O other than that in this version, application code
27
- changes should be minimal. Using the fast I/O mechanism in this version
28
- requires changing just one line of code compared to running under the official
29
- version.
28
+ technique for writing stream I/O drivers. Code using such drivers will run
29
+ unchanged under the ` fast_io ` version. Using the fast I/O mechanism requires
30
+ adding just one line of code. This implies that if official ` uasyncio ` acquires
31
+ a means of prioritising I/O other than that in this version, application code
32
+ changes should be minimal.
30
33
31
34
The high priority mechanism formerly provided in ` asyncio_priority.py ` was a
32
35
workround based on the view that stream I/O written in Python would remain
Original file line number Diff line number Diff line change @@ -264,10 +264,10 @@ def run_forever(self):
264
264
def run_until_complete (self , coro ):
265
265
assert not isinstance (coro , type_genf ), 'Coroutine arg expected.' # upy issue #3241
266
266
def _run_and_stop ():
267
- yield from coro
268
- yield StopLoop (0 )
267
+ ret = yield from coro # https://github.com/micropython/micropython-lib/pull/270
268
+ yield StopLoop (ret )
269
269
self .call_soon (_run_and_stop ())
270
- self .run_forever ()
270
+ return self .run_forever ()
271
271
272
272
def stop (self ):
273
273
self .call_soon ((lambda : (yield StopLoop (0 )))())
You can’t perform that action at this time.
0 commit comments