Skip to main content

Module exec_plan

Module exec_plan 

Source
Expand description

#2719: which functions need the execution context, and where one is not available to give them.

e.detach(), e.within(d) and a.race(b) hand work to the execution context’s waitUntil. A service handler reaches it as deps.__exec; a function has no deps, so a function whose body (or a function it calls, or names as a value) uses one of the three takes it as a hidden trailing parameter. This module computes that needs-context set (a fixed point over a unit’s functions, against the set its dependencies already settled) and refuses a call that would bring the construct into a place with no context (bynk.exec.unavailable).

The set is built after type checking, from what the checker resolved: a within or race counts only when the checker recorded it as the kernel method on an Effect receiver (Callee::Kernel), never by name, so a user type’s own race method puts nothing in the set.

Members are keyed by their declaration’s Span: the file id is unique across a build (dependency packages included), so a callee reached through uses, a package alias or a sibling file names the same key as its declaration.

Structs§

ExecPlan
The needs-context set for a build so far: every effectful function that takes the hidden __exec parameter, and every service handler whose deps must carry __exec (its body uses a construct, or calls or names a member).

Enums§

Why
Why a function is in the needs-context set.

Type Aliases§

SharedExecPlan
A shared snapshot, as carried on a TypedCommons.