trigger.dev
Version:
A Command-Line Interface for Trigger.dev projects
58 lines (57 loc) • 1.91 kB
TypeScript
import { DequeuedMessage, LogLevel } from "@trigger.dev/core/v3";
import { CliApiClient } from "../apiClient.js";
import { BackgroundWorker } from "../dev/backgroundWorker.js";
import { TaskRunProcessPool } from "../dev/taskRunProcessPool.js";
type DevRunControllerOptions = {
runFriendlyId: string;
worker: BackgroundWorker;
httpClient: CliApiClient;
logLevel: LogLevel;
taskRunProcessPool: TaskRunProcessPool;
onSubscribeToRunNotifications: (run: Run, snapshot: Snapshot) => void;
onUnsubscribeFromRunNotifications: (run: Run, snapshot: Snapshot) => void;
onFinished: () => void;
cwd?: string;
};
type Run = {
friendlyId: string;
attemptNumber?: number | null;
};
type Snapshot = {
friendlyId: string;
};
export declare class DevRunController {
private readonly opts;
private taskRunProcess?;
private readonly worker;
private readonly httpClient;
private readonly snapshotPoller;
private readonly snapshotPollIntervalSeconds;
private readonly cwd?;
private isCompletingRun;
private isShuttingDown;
private state;
private enterRunPhase;
constructor(opts: DevRunControllerOptions);
private updateRunPhase;
private onExitRunPhase;
private subscribeToRunNotifications;
private unsubscribeFromRunNotifications;
private get runFriendlyId();
private get snapshotFriendlyId();
get workerFriendlyId(): string;
private handleSnapshotChangeLock;
private handleSnapshotChange;
private startAndExecuteRunAttempt;
private executeRun;
private handleCompletionResult;
private exitTaskRunProcessWithoutFailingRun;
private shutdownExecution;
private runFinished;
private cancelAttempt;
start(dequeueMessage: DequeuedMessage): Promise<void>;
stop(): Promise<void>;
getLatestSnapshot(): Promise<void>;
resubscribeToRunNotifications(): void;
}
export {};