-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Description
There are a few instances where it can be ambiguous whether an async function has completed:
- Error handling — the example uses
errdefer if (!awaited_download_frame) {but this can be converted to beerrdefer if (!@frameState(download_frame).awaited) { - Generators — liveness is an indicator of completion, but there's currently not a way for the execution context to check
It'd be nice if we could check the "state" of the async function. Braindump:
const FrameState = struct {
running: bool, // not sure if we should expose "suspended" as it sounds like a concurrent problem
awaited: bool,
};
@frameState(f: anyframe) FrameStateReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.