silk/local_scheduler
Deterministic single-threaded execution for structured Fibers.
When to use
Use execute at an application entry point to run one lazy program that uses the
silk.scheduler.Scheduler service.
Details
Each call creates fresh task storage and a FIFO ready queue. The root is task zero and uses the
same Execution<()> storage as every child. execute returns only after the root terminates.
Import as LocalScheduler with import silk.local_scheduler.
Public declarations: 4.
LocalScheduler
pub struct LocalSchedulerA reusable deterministic single-threaded Scheduler provider.
Details
Each call to execute creates fresh task storage and readiness state.
StalledError
pub struct StalledErrorReports that no task is ready while the root is incomplete.
Details
execute cancels and releases the incomplete task tree before it raises this error.
make
pub fn make() -> LocalSchedulerConstructs a reusable local Scheduler value.
Implementation Copy for NoLink
impl Copy for NoLinkImplementation Copy for TaskLink
impl Copy for TaskLinkImplementation Scheduler.Scheduler for SchedulerClient
impl Scheduler.Scheduler for SchedulerClientOperation prepare
prepare = SchedulerClient.prepareChildexecute
pub effect fn execute<A, E>(self: &mut silk/local_scheduler.LocalScheduler, program: once Effect<A ! E ? &mut silk/scheduler.Scheduler>) -> A ! E | OutOfMemoryError | StalledErrorRuns one lazy root program under this Scheduler and returns its typed outcome.
Details
The root becomes task zero. This operation owns all per-run task storage, provides one distinct
Scheduler client to each task, and dispatches ready tasks in FIFO order. Before it returns a
root value or raises a typed error, it cancels every unfinished descendant and releases the
run state. If the root is incomplete when no task is ready, it performs the same cleanup and
raises StalledError.