@dxos/compute - v0.16.0
    Preparing search index...

    Interface DurableContext<I, O>

    Runtime context handed to a durable operation's create.

    interface DurableContext<I, O> {
        id: string & Brand<"ProcessId">;
        params: Params;
        fail(error: Error): void;
        setAlarm(timeout?: number): Effect<void>;
        submitOutput(output: O): void;
        succeed(): void;
    }

    Type Parameters

    • I
    • O
    Index

    Properties

    id: string & Brand<"ProcessId">
    params: Params

    Parameters assigned during process creation.

    Methods

    • Set an alarm for the process to be woken up later. onAlarm runs with the process's own context, not the caller's: an alarm scheduled from inside a handler does not nest under it.

      Parameters

      • Optionaltimeout: number

        Optional timeout in milliseconds. If not provided, the process is woken up as soon as possible.

      Returns Effect<void>