MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / enqueue

Function enqueue

app/src/server/tasks/defineTask.ts:27–34  ·  view source on GitHub ↗
(payload: TPayload, spec?: TaskSpec)

Source from the content-addressed store, hash-verified

25 specDefaults?: TaskSpec;
26}) {
27 const enqueue = async (payload: TPayload, spec?: TaskSpec) => {
28 const mergedSpec = merge({}, options.specDefaults, spec);
29
30 await options.beforeEnqueue?.(payload);
31
32 const utils = await workerUtils();
33 return await utils.addJob(options.id, payload, mergedSpec);
34 };
35
36 const handler = (payload: TPayload, helpers: Helpers) => {
37 helpers.logger.debug(`Running task ${options.id} with payload: ${JSON.stringify(payload)}`);

Callers

nothing calls this directly

Calls 1

workerUtilsFunction · 0.85

Tested by

no test coverage detected