Skip to content

Commit b60be19

Browse files
committed
Updates to README.md.
1 parent 0319bd4 commit b60be19

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

README.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Use of MicroPython uasyncio library
1+
# 1. The MicroPython uasyncio library
22

33
This GitHub repository consists of the following parts:
44
* [A tutorial](./TUTORIAL.md) An introductory tutorial on asynchronous
@@ -19,19 +19,22 @@ This GitHub repository consists of the following parts:
1919
boards to communicate without using a UART. Primarily intended to enable a
2020
a Pyboard-like device to achieve bidirectional communication with an ESP8266.
2121

22-
# Installation of uasyncio
22+
# 2. Installation of uasyncio
2323

2424
Firstly install the latest version of `micropython-uasyncio`. To use queues,
2525
also install the `micropython-uasyncio.queues` module. A `Lock` synchronisation
2626
primitive is provided by `micropython-uasyncio.synchro`.
2727

28-
Instructions on installing library modules may be found [here](https://github.com/micropython/micropython-lib).
28+
Instructions on installing library modules may be found
29+
[here](https://github.com/micropython/micropython-lib).
2930

30-
On networked hardware, upip may be run locally. The [tutorial](./TUTORIAL.md#installing-uasyncio-on-bare-metal)
31-
has instructions for a method of installation on non-networked baremetal
32-
targets.
31+
On networked hardware, upip may be run locally. The
32+
[tutorial](./TUTORIAL.md#installing-uasyncio-on-bare-metal) has instructions
33+
for methods of installation on non-networked baremetal targets.
3334

34-
# Current development state
35+
# 3. uasyncio development state
36+
37+
These notes are intended for users familiar with `asyncio` under CPython.
3538

3639
The MicroPython language is based on CPython 3.4. The `uasyncio` library
3740
supports a subset of the CPython 3.4 `asyncio` library with some V3.5
@@ -61,23 +64,12 @@ cancellation.
6164

6265
Classes `Task` and `Future` are not supported.
6366

64-
## Synchronisation Primitives and Task Cancellation
65-
66-
The library `asyn.py` provides 'micro' implementations of the `asyncio`
67-
[synchronisation primitives](https://docs.python.org/3/library/asyncio-sync.html).
68-
Because `uasyncio` does not support `Task` and `Future` classes `asyncio`
69-
features such as `wait` and `gather` are unavailable. A `Barrier` class enables
70-
coroutines to be similarly synchronised. Coroutine cancellation is performed in
71-
a special efficient manner in `uasyncio`. The `asyn` library enhances this by
72-
facilitating options to pause until cancellation is complete and to check the
73-
status of individual coroutines.
67+
## 3.1 Asynchronous I/O
7468

75-
## Asynchronous I/O
69+
Asynchronous I/O works with devices whose drivers support streaming, such as
70+
UARTs.
7671

77-
At the time of writing this was under development. Asynchronous I/O works with
78-
devices whose drivers support streaming, such as the UART.
79-
80-
## Time values
72+
## 3.2 Time values
8173

8274
For timing asyncio uses floating point values of seconds. The `uasyncio.sleep`
8375
method accepts floats (including sub-second values) or integers. Note that in
@@ -89,3 +81,17 @@ millisecond level functions (with integer arguments) employed where necessary.
8981
The `loop.time` method returns an integer number of milliseconds whereas
9082
CPython returns a floating point number of seconds. `call_at` follows the
9183
same convention.
84+
85+
# 4. The asyn.py library
86+
87+
This library provides 'micro' implementations of the `asyncio` synchronisation
88+
primitives [CPython docs](https://docs.python.org/3/library/asyncio-sync.html).
89+
90+
It also supports a `Barrier` class to facilitate coroutine synchronisation.
91+
92+
Coroutine cancellation is performed in an efficient manner in `uasyncio`. The
93+
`asyn` library enhances this by enabling the cancelling coro to pause until
94+
cancellation is complete and to check the 'running' status of individual
95+
coroutines.
96+
97+
A lightweight implementation of `asyncio.gather` is provided.

0 commit comments

Comments
 (0)