Interface StepRetrying

The executor decided to attempt a step again. Its own rule always decides it.

import type { DecidedBy, Event, GiveUpHook } from "itinera/event";

function decider(decidedBy: DecidedBy): string {
return decidedBy === "default"
? "by default"
: `by ${decidedBy.policy}, ${decidedBy.hook}`;
}

export function givenUpAfter(hook: GiveUpHook): string {
return hook === "on step retry"
? "before a retry"
: "after an abnormal termination";
}

export function decision(event: Event): string | undefined {
if (event.kind === "step_given_up") {
return `${event.step} given up: ${event.cause}, ${decider(event.decidedBy)}`;
}
if (event.kind === "journey_failed" || event.kind === "journey_succeeded") {
return `${event.kind} ${decider(event.decidedBy)}`;
}
return undefined;
}
interface StepRetrying {
    attempt: Attempt;
    cause: "failure" | "abnormal termination";
    decidedBy: "default";
    journeyId: JourneyId;
    kind: "step_retrying";
    sequence: number;
    step: StepName;
    timestamp: Timestamp;
    workflow: WorkflowName;
}

Hierarchy (View Summary)

Index

attempt: Attempt

The attempt.

cause: "failure" | "abnormal termination"

How the attempt failed.

decidedBy: "default"

Who decided it.

journeyId: JourneyId

The journey's ID.

kind: "step_retrying"

The event's kind, which tells what else it carries.

sequence: number

The event's position in its journey's event stream, from 1.

step: StepName

The step's name.

timestamp: Timestamp

When the event was emitted.

workflow: WorkflowName

The workflow's name.