Skip to content

Commit 2feddfa

Browse files
committed
Improvements to docs.
1 parent 043640e commit 2feddfa

File tree

1 file changed

+49
-97
lines changed

1 file changed

+49
-97
lines changed

TUTORIAL.md

Lines changed: 49 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -65,105 +65,57 @@ and rebuilding.
6565

6666
1. [Cooperative scheduling](./TUTORIAL.md#1-cooperative-scheduling)
6767
1.1 [Modules](./TUTORIAL.md#11-modules)
68-
2. [uasyncio](./TUTORIAL.md#2-uasyncio)
69-
70-
2.1 [Program structure: the event loop](./TUTORIAL.md#21-program-structure-the-event-loop)
71-
72-
2.2 [Coroutines (coros)](./TUTORIAL.md#22-coroutines-coros)
73-
74-
2.2.1 [Queueing a coro for scheduling](./TUTORIAL.md#221-queueing-a-coro-for-scheduling)
75-
76-
2.2.2 [Running a callback function](./TUTORIAL.md#222-running-a-callback-function)
77-
78-
2.2.3 [Notes](./TUTORIAL.md#223-notes) Coros as bound methods. Returning values.
79-
80-
2.3 [Delays](./TUTORIAL.md#23-delays)
81-
82-
3. [Synchronisation](./TUTORIAL.md#3-synchronisation)
83-
84-
3.1 [Lock](./TUTORIAL.md#31-lock)
85-
86-
3.1.1 [Locks and timeouts](./TUTORIAL.md#311-locks-and-timeouts)
87-
88-
3.2 [Event](./TUTORIAL.md#32-event)
89-
90-
3.2.1 [The event's value](./TUTORIAL.md#321-the-events-value)
91-
92-
3.3 [Barrier](./TUTORIAL.md#33-barrier)
93-
94-
3.4 [Semaphore](./TUTORIAL.md#34-semaphore)
95-
96-
3.4.1 [BoundedSemaphore](./TUTORIAL.md#341-boundedsemaphore)
97-
98-
3.5 [Queue](./TUTORIAL.md#35-queue)
99-
100-
3.6 [Task cancellation](./TUTORIAL.md#36-task-cancellation)
101-
102-
3.7 [Other synchronisation primitives](./TUTORIAL.md#37-other-synchronisation-primitives)
103-
104-
4. [Designing classes for asyncio](./TUTORIAL.md#4-designing-classes-for-asyncio)
105-
106-
4.1 [Awaitable classes](./TUTORIAL.md#41-awaitable-classes)
107-
108-
4.1.1 [Use in context managers](./TUTORIAL.md#411-use-in-context-managers)
109-
110-
4.1.2 [Awaiting a coro](./TUTORIAL.md#412-awaiting-a-coro)
111-
112-
4.2 [Asynchronous iterators](./TUTORIAL.md#42-asynchronous-iterators)
113-
114-
4.3 [Asynchronous context managers](./TUTORIAL.md#43-asynchronous-context-managers)
115-
116-
4.4 [Coroutines with timeouts](./TUTORIAL.md#44-coroutines-with-timeouts)
117-
118-
4.5 [Exceptions](./TUTORIAL.md#45-exceptions)
119-
120-
5. [Interfacing hardware](./TUTORIAL.md#5-interfacing-hardware)
121-
122-
5.1 [Timing issues](./TUTORIAL.md#51-timing-issues)
123-
124-
5.2 [Polling hardware with a coroutine](./TUTORIAL.md#52-polling-hardware-with-a-coroutine)
125-
126-
5.3 [Using the stream mechnanism](./TUTORIAL.md#53-using-the-stream-mechanism)
127-
128-
5.3.1 [A UART driver example](./TUTORIAL.md#531-a-uart-driver-example)
129-
130-
5.4 [Writing streaming device drivers](./TUTORIAL.md#54-writing-streaming-device-drivers)
131-
68+
2. [uasyncio](./TUTORIAL.md#2-uasyncio)
69+
2.1 [Program structure: the event loop](./TUTORIAL.md#21-program-structure-the-event-loop)
70+
2.2 [Coroutines (coros)](./TUTORIAL.md#22-coroutines-coros)
71+
2.2.1 [Queueing a coro for scheduling](./TUTORIAL.md#221-queueing-a-coro-for-scheduling)
72+
2.2.2 [Running a callback function](./TUTORIAL.md#222-running-a-callback-function)
73+
2.2.3 [Notes](./TUTORIAL.md#223-notes) Coros as bound methods. Returning values.
74+
2.3 [Delays](./TUTORIAL.md#23-delays)
75+
3. [Synchronisation](./TUTORIAL.md#3-synchronisation)
76+
3.1 [Lock](./TUTORIAL.md#31-lock)
77+
3.1.1 [Locks and timeouts](./TUTORIAL.md#311-locks-and-timeouts)
78+
3.2 [Event](./TUTORIAL.md#32-event)
79+
3.2.1 [The event's value](./TUTORIAL.md#321-the-events-value)
80+
3.3 [Barrier](./TUTORIAL.md#33-barrier)
81+
3.4 [Semaphore](./TUTORIAL.md#34-semaphore)
82+
3.4.1 [BoundedSemaphore](./TUTORIAL.md#341-boundedsemaphore)
83+
3.5 [Queue](./TUTORIAL.md#35-queue)
84+
3.6 [Task cancellation](./TUTORIAL.md#36-task-cancellation)
85+
3.7 [Other synchronisation primitives](./TUTORIAL.md#37-other-synchronisation-primitives)
86+
4. [Designing classes for asyncio](./TUTORIAL.md#4-designing-classes-for-asyncio)
87+
4.1 [Awaitable classes](./TUTORIAL.md#41-awaitable-classes)
88+
4.1.1 [Use in context managers](./TUTORIAL.md#411-use-in-context-managers)
89+
4.1.2 [Awaiting a coro](./TUTORIAL.md#412-awaiting-a-coro)
90+
4.2 [Asynchronous iterators](./TUTORIAL.md#42-asynchronous-iterators)
91+
4.3 [Asynchronous context managers](./TUTORIAL.md#43-asynchronous-context-managers)
92+
4.4 [Coroutines with timeouts](./TUTORIAL.md#44-coroutines-with-timeouts)
93+
4.5 [Exceptions](./TUTORIAL.md#45-exceptions)
94+
5. [Interfacing hardware](./TUTORIAL.md#5-interfacing-hardware)
95+
5.1 [Timing issues](./TUTORIAL.md#51-timing-issues)
96+
5.2 [Polling hardware with a coroutine](./TUTORIAL.md#52-polling-hardware-with-a-coroutine)
97+
5.3 [Using the stream mechnanism](./TUTORIAL.md#53-using-the-stream-mechanism)
98+
5.3.1 [A UART driver example](./TUTORIAL.md#531-a-uart-driver-example)
99+
5.4 [Writing streaming device drivers](./TUTORIAL.md#54-writing-streaming-device-drivers)
132100
5.5 [A complete example: aremote.py](./TUTORIAL.md#55-a-complete-example-aremotepy)
133-
A driver for an IR remote control receiver.
134-
101+
A driver for an IR remote control receiver.
135102
5.6 [Driver for HTU21D](./TUTORIAL.md#56-htu21d-environment-sensor) A
136-
temperature and humidity sensor.
137-
138-
6. [Hints and tips](./TUTORIAL.md#6-hints-and-tips)
139-
140-
6.1 [Program hangs](./TUTORIAL.md#61-program-hangs)
141-
142-
6.2 [uasyncio retains state](./TUTORIAL.md#62-uasyncio-retains-state)
143-
144-
6.3 [Garbage Collection](./TUTORIAL.md#63-garbage-collection)
145-
146-
6.4 [Testing](./TUTORIAL.md#64-testing)
147-
148-
6.5 [A common error](./TUTORIAL.md#65-a-common-error) This can be hard to find.
149-
150-
6.6 [Socket programming](./TUTORIAL.md#66-socket-programming)
151-
152-
7. [Notes for beginners](./TUTORIAL.md#7-notes-for-beginners)
153-
154-
7.1 [Problem 1: event loops](./TUTORIAL.md#71-problem-1:-event-loops)
155-
156-
7.2 [Problem 2: blocking methods](./TUTORIAL.md#7-problem-2:-blocking-methods)
157-
158-
7.3 [The uasyncio approach](./TUTORIAL.md#73-the-uasyncio-approach)
159-
160-
7.4 [Scheduling in uasyncio](./TUTORIAL.md#74-scheduling-in-uasyncio)
161-
162-
7.5 [Why cooperative rather than pre-emptive?](./TUTORIAL.md#75-why-cooperative-rather-than-pre-emptive)
163-
164-
7.6 [Communication](./TUTORIAL.md#76-communication)
165-
166-
7.7 [Polling](./TUTORIAL.md#77-polling)
103+
temperature and humidity sensor.
104+
6. [Hints and tips](./TUTORIAL.md#6-hints-and-tips)
105+
6.1 [Program hangs](./TUTORIAL.md#61-program-hangs)
106+
6.2 [uasyncio retains state](./TUTORIAL.md#62-uasyncio-retains-state)
107+
6.3 [Garbage Collection](./TUTORIAL.md#63-garbage-collection)
108+
6.4 [Testing](./TUTORIAL.md#64-testing)
109+
6.5 [A common error](./TUTORIAL.md#65-a-common-error) This can be hard to find.
110+
6.6 [Socket programming](./TUTORIAL.md#66-socket-programming)
111+
7. [Notes for beginners](./TUTORIAL.md#7-notes-for-beginners)
112+
7.1 [Problem 1: event loops](./TUTORIAL.md#71-problem-1:-event-loops)
113+
7.2 [Problem 2: blocking methods](./TUTORIAL.md#7-problem-2:-blocking-methods)
114+
7.3 [The uasyncio approach](./TUTORIAL.md#73-the-uasyncio-approach)
115+
7.4 [Scheduling in uasyncio](./TUTORIAL.md#74-scheduling-in-uasyncio)
116+
7.5 [Why cooperative rather than pre-emptive?](./TUTORIAL.md#75-why-cooperative-rather-than-pre-emptive)
117+
7.6 [Communication](./TUTORIAL.md#76-communication)
118+
7.7 [Polling](./TUTORIAL.md#77-polling)
167119

168120
# 1. Cooperative scheduling
169121

0 commit comments

Comments
 (0)