Skip to content

Commit 31256b8

Browse files
committed
CABI: refactor to simplify cancellation
1 parent 8c6bf79 commit 31256b8

File tree

5 files changed

+903
-910
lines changed

5 files changed

+903
-910
lines changed

design/mvp/Async.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ While the two approaches have significant runtime implementation differences
409409
(the former requires [fibers] or a [CPS transform] while the latter only
410410
requires storing fixed-size context-local storage and [`Task`] state),
411411
semantically they do the same thing which, in the Canonical ABI Python code, is
412-
factored out into the [`Task.wait`] method. Thus, the difference between
412+
factored out into the [`Task.wait_on`] method. Thus, the difference between
413413
`callback` and non-`callback` is one of optimization, not expressivity.
414414

415415
In addition to waiting for an event to occur, a task can also **poll** for
@@ -470,9 +470,8 @@ loop interleaving `stream.read`s (of the readable end passed for `in`) and
470470
`stream.write`s (of the writable end it `stream.new`ed) before exiting the
471471
task.
472472

473-
A task may not call `task.return` unless it is in the "started" state. Once
474-
`task.return` is called, the task is in the "returned" state. A task can only
475-
finish once it is in the "returned" state. See the [`canon_task_return`]
473+
Once `task.return` is called, the task is in the "returned" state. A task can
474+
only finish once it is in the "returned" state. See the [`canon_task_return`]
476475
function in the Canonical ABI explainer for more details.
477476

478477
### Borrows
@@ -976,7 +975,7 @@ comes after:
976975
[`canon_task_return`]: CanonicalABI.md#-canon-taskreturn
977976
[`Task`]: CanonicalABI.md#task-state
978977
[`Task.enter`]: CanonicalABI.md#task-state
979-
[`Task.wait`]: CanonicalABI.md#task-state
978+
[`Task.wait_on`]: CanonicalABI.md#task-state
980979
[`Waitable`]: CanonicalABI.md#waitable-state
981980
[`Task`]: CanonicalABI.md#task-state
982981
[`Subtask`]: CanonicalABI.md#subtask-state

0 commit comments

Comments
 (0)