Reference

Workers API Reference

interface WorkerMetadata {
  queue: string;
  endpoint: EndpointOptions;
  opts?: WorkerOptions;
}
interface EndpointOptions {
    url: string;
    method: "post" | "get" | "put" | "delete" | "patch";
    headers?: Record<string, string>;
    timeout?: number; // max allowed duration in milliseconds
}
interface WorkerOptions {
  concurrency?: number;
  limiter?: {
    max: number; // integer representing max number of jobs to process on "duration"
    duration: number: // number of millisecons
  };
  removeOnComplete?: {
    count?: number;
    age?: number;
  };
  removeOnFail?: {
    count?: number;
    age?: number;
  };
  maxStalledCount?: number;
}

Workers API

Add / Update a worker

POST /workers

Adds a new worker or updates an existing one.

Headers

Body

Response

"OK"

Remove worker

DELETE /workers/:queue-name

Removes an existing worker for a given queue.

Headers

Response

"OK"

Get workers

GET /workers

Gets all the workers registered in the proxy.

Headers

Response

{
  "queue-name": "url"
}

Last updated