Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 866 Bytes

File metadata and controls

50 lines (37 loc) · 866 Bytes

Getting Started with JetQueue

Installation

npm install @jet-queue/core

Your First Queue

import { JetQueue } from "@jet-queue/core";

const queue = new JetQueue({ concurrency: 3 });

queue.add(
  async () => {
    console.log("Job done!");
  },
  { name: "my-first-job" },
);

queue.on("queue:drain", () => {
  console.log("All jobs finished");
});

Using the Server (Bun)

npx @jet-queue/server --port 3001

Then connect with the client:

npm install @jet-queue/client
import { JetQueueClient } from "@jet-queue/client";
const client = new JetQueueClient({ baseUrl: "http://localhost:3001" });
await client.addJob("send-email", { data: { to: "user@test.com" } });

Next Steps