silk.build.execution.

Deferred storage for a build step's work, using the ordinary fiber execution boundary.

Construction packages the work without running it. The graph runner supplies its resolved context when the dependencies are complete, then drives the work on a worker fiber.

Import as Pending with import silk.build.execution { Pending }.

Public declarations: 2.

Work#

silk
pub interface Work<C, A, E>

Owned work whose resolved context is supplied only when the graph runs it.

Operation perform#

silk
effect fn perform(self: Self, context: C) -> A ! E

Runs once after all declared inputs have been resolved.

Pending#

silk
pub struct Pending<C, A, E>

A dormant step with one execution and no resolved inputs yet.

Implementation Pending<C, A, E>#

silk
impl<C: Transferable + 'static, A: Transferable + 'static, E: Transferable + 'static> Pending<C, A, E>

Associated function make#

silk
pub effect fn make<T: Work<C, A, E> + Transferable + 'static>(work: T) -> Self
  ! OutOfMemoryError ? &mut Allocator

Packages owned work without calling it. Allocation failure runs no work.

Method execute#

silk
pub effect fn execute(self: Self, context: C) -> A ! E

Supplies the resolved inputs and drives the work to completion, preserving typed failures. A parked step resumes only after its execution's readiness notification.

Method finish#

silk
pub effect fn finish(self: Self, context: C) -> A ! E

Supplies the resolved inputs and drives work that blocks instead of parking to completion on the calling thread, so a caller without a scheduler can run it.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page