MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / runTask

Method runTask

integrations/replicate/src/index.ts:68–91  ·  view source on GitHub ↗
(
    key: IntegrationTaskKey,
    callback: (client: ReplicateClient, task: IOTask, io: IO) => Promise<TResult>,
    options?: RunTaskOptions,
    errorCallback?: RunTaskErrorCallback
  )

Source from the content-addressed store, hash-verified

66 }
67
68 runTask<T, TResult extends Json<T> | void>(
69 key: IntegrationTaskKey,
70 callback: (client: ReplicateClient, task: IOTask, io: IO) => Promise<TResult>,
71 options?: RunTaskOptions,
72 errorCallback?: RunTaskErrorCallback
73 ): Promise<TResult> {
74 if (!this._io) throw new Error("No IO");
75 if (!this._connectionKey) throw new Error("No connection key");
76
77 return this._io.runTask(
78 key,
79 (task, io) => {
80 if (!this._client) throw new Error("No client");
81 return callback(this._client, task, io);
82 },
83 {
84 icon: "replicate",
85 retry: retry.standardBackoff,
86 ...(options ?? {}),
87 connectionKey: this._connectionKey,
88 },
89 errorCallback ?? onError
90 );
91 }
92
93 get collections() {
94 return new Collections(this.runTask.bind(this));

Callers 15

requestMethod · 0.95
getMethod · 0.45
listMethod · 0.45
cancelMethod · 0.45
createMethod · 0.45
createAndAwaitMethod · 0.45
getMethod · 0.45
listMethod · 0.45
createMethod · 0.45
createAndAwaitMethod · 0.45
getMethod · 0.45
getMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected