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

    Interface State

    Runtime state of a trigger.

    interface State {
        cooldownUntil?: Date;
        environment: "edge" | "local";
        lastResult: null | Exit<unknown, never>;
        nextExecution?: Date;
        retry?: {
            enqueuedAt: number;
            event:
                | {
                    body: string;
                    created: string;
                    from: string;
                    subject: string;
                    to: string;
                }
                | {
                    cursor: string;
                    feed: Ref<Feed & OfKind<Object> & Unknown>;
                    item: any;
                    items?: readonly any[];
                }
                | {
                    changedObjectId?: string;
                    subject: Ref<Unknown>;
                    type: "updated" | "created" | "deleted";
                }
                | { tick: number }
                | { data?: { readonly [key: string]: any } }
                | {
                    bodyText: string;
                    headers: { readonly [key: string]: string };
                    method: "GET" | "POST";
                    url: string;
                };
        };
        trigger: Ref<Trigger.Trigger>;
    }
    Index

    Properties

    cooldownUntil?: Date

    Time until which scheduled invocations of this trigger are skipped after a genuine failure. Applies to all trigger kinds. Manual TriggerDispatcher.invokeTrigger calls bypass it.

    environment: "edge" | "local"

    Where is this trigger running.

    lastResult: null | Exit<unknown, never>

    Result of the most recent invocation of this trigger.

    nextExecution?: Date

    Next scheduled cron execution. Set only for timer triggers.

    retry?: {
        enqueuedAt: number;
        event:
            | {
                body: string;
                created: string;
                from: string;
                subject: string;
                to: string;
            }
            | {
                cursor: string;
                feed: Ref<Feed & OfKind<Object> & Unknown>;
                item: any;
                items?: readonly any[];
            }
            | {
                changedObjectId?: string;
                subject: Ref<Unknown>;
                type: "updated" | "created" | "deleted";
            }
            | { tick: number }
            | { data?: { readonly [key: string]: any } }
            | {
                bodyText: string;
                headers: { readonly [key: string]: string };
                method: "GET" | "POST";
                url: string;
            };
    }

    Pending re-invocation requested via Operation.runAgain (RunAgainError). Retries are drained at the tail of the invocation queue, ordered by enqueuedAt.

    Type declaration

    • ReadonlyenqueuedAt: number

      Monotonic sequence number used to order pending retries FIFO at the tail of the queue.

    • Readonlyevent:
          | {
              body: string;
              created: string;
              from: string;
              subject: string;
              to: string;
          }
          | {
              cursor: string;
              feed: Ref<Feed & OfKind<Object> & Unknown>;
              item: any;
              items?: readonly any[];
          }
          | {
              changedObjectId?: string;
              subject: Ref<Unknown>;
              type: "updated" | "created" | "deleted";
          }
          | { tick: number }
          | { data?: { readonly [key: string]: any } }
          | {
              bodyText: string;
              headers: { readonly [key: string]: string };
              method: "GET" | "POST";
              url: string;
          }

      Event to replay on the retry. Re-running is assumed safe with the same input.

    trigger: Ref<Trigger.Trigger>

    Reference to the trigger object.