Skip to content
quickbits-ioPublic

About

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

153 Commits

Folders and files

Repository files navigation

OpenQueue

CI npm license

A batteries-included background job framework for TypeScript, built on BullMQ and Redis. You define tasks as plain functions with a Zod schema; OpenQueue handles queues, workers, validation, retries, scheduling, flows, and observability — and ships a real dashboard (Workbench) inside your worker.

import { task } from '@openqueue/sdk';
import { z } from 'zod';

export const sendWelcome = task({
  id: 'send-welcome',
  schema: z.object({ email: z.string().email() }),
  run: async (payload, ctx) => {
    ctx.logger.info('sending welcome email', { email: payload.email });
    return { ok: true };
  },
});

// anywhere in your app
await sendWelcome.trigger({ email: '[email protected]' });

Why OpenQueue

  • No new infrastructure. Runs on the Redis you already have. Run history can persist to the Postgres you already have, via Drizzle.
  • Typed end to end. The Zod schema validates payloads at trigger time and types them inside run.
  • Operations included. Workbench gives you live counters, run inspection, retry-from-the-UI, flow graphs, schedules, error triage, and a test console — without building an admin page.
  • Boring failure semantics. Three attempts with exponential backoff by default; a small error taxonomy (RetryableError, NonRetryableError, timeouts, TTLs) when you need control.

Quickstart

You need a Redis URL and Bun.

bun add @openqueue/sdk
bun add -d @openqueue/cli
bunx openqueue init

init scaffolds worker.config.ts, a starter task, env files, and a Dockerfile, then run:

bunx openqueue dev

See the full quickstart and the rest of the docs under site/content/docs. Upgrading from 0.1.x? Read MIGRATION.md (or the full Upgrading to 1.0 guide) — most apps need no code changes.

Packages

Package Description
@openqueue/sdk The main entry — task(), defineConfig(), enqueueFlow(), errors, adapters.
@openqueue/core The underlying runtime (re-exported by @openqueue/sdk).
@openqueue/client Fetch-only HTTP client for a deployed worker — zero Redis/DB (also @openqueue/sdk/client).
@openqueue/worker The worker app — loads your config, runs tasks, serves Workbench.
@openqueue/workbench The dashboard — standalone or mountable into any fetch-native host (h3 / Next.js).
@openqueue/world-bullmq The default delivery world — BullMQ over Redis. The redis config sugar resolves to it.
@openqueue/world-postgres A self-migrating Postgres world — one database for jobs and history, no Redis.
@openqueue/cli The openqueue CLI — init, dev, build, start.

Runtime note: the Node-capable packages (@openqueue/core, @openqueue/sdk, @openqueue/client, @openqueue/workbench, @openqueue/world-bullmq, @openqueue/world-postgres, @openqueue/worker) run on Node 20.11.1+ or Bun. @openqueue/cli is Bun-native (it uses Bun's process and glob APIs). The worker's production artifact — built by the CLI via Nitro — runs on Node ^20.19 || >=22.12 or Bun.

Repository layout

This is a Bun workspace orchestrated with Turborepo:

packages/
  core/            @openqueue/core           — runtime engine
  openqueue/       @openqueue/sdk            — public SDK (flagship package)
  client/          @openqueue/client         — fetch-only HTTP client
  worker/          @openqueue/worker         — worker runtime
  cli/             @openqueue/cli            — the `openqueue` binary
  workbench/       @openqueue/workbench      — dashboard UI + server adapters
  world-bullmq/    @openqueue/world-bullmq   — BullMQ/Redis delivery world
  world-postgres/  @openqueue/world-postgres — self-migrating Postgres world
site/              docs & marketing site (Next.js + Fumadocs)
examples/
  basic/           a minimal worker you can run end to end

Common commands

bun install        # install everything
bun run build      # build all packages (tsup + Vite) and the site
bun run dev        # watch-build libraries / run the workbench dev server
bun run typecheck  # tsc --noEmit across the workspace
bun run test       # vitest
bun run lint       # biome

Contributing

See CONTRIBUTING.md. In short: open a PR with Conventional Commits — release-please reads them to version and publish the @openqueue/* packages in lockstep.

License

MIT © Quickbits

About

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages