Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Queue
✓ import { Queue } from 'glide-mq'
✗ const Queue = require('glide-mq').Queue
ESM-only since v0.15; CJS require is functional but deprecated. Use named import.
Worker
✓ import { Worker } from 'glide-mq'
Typical usage paired with Queue. Worker options must include 'connection'.
Flow
✓ import { Flow } from 'glide-mq'
✗ import { FlowProducer } from 'glide-mq'
glide-mq uses 'Flow' instead of BullMQ's 'FlowProducer'. Flow orchestrates parent-child DAGs.
type Job
✓ import type { Job } from 'glide-mq'
TypeScript users should import Job type for worker function parameter typing.
default export
✓ import glideMq from 'glide-mq'
✗ import * as glideMq from 'glide-mq'
Default export is the GlideMQ class (singleton), not commonly used; prefer named imports.
Creates a queue, adds a job, and processes it with a worker. Uses Redis/Valkey connection, sets concurrency to 10.
import { Queue, Worker } from 'glide-mq';
const connection = { addresses: [{ host: 'localhost', port: 6379 }] };
const queue = new Queue('tasks', { connection });
await queue.add('send-email', {
to: 'user@example.com',
subject: 'Welcome',
});
const worker = new Worker(
'tasks',
async (job) => {
console.log(`Processing job ${job.id}: ${job.name}`);
await sendEmail(job.data.to, job.data.subject);
return { sent: true };
},
{ connection, concurrency: 10 },
);
Debug
Known issues
breakingIn v0.14.x, 'connection' option required 'host' and 'port' as direct properties; v0.15 changed to nested 'addresses' array.fixUse { addresses: [{ host: '...', port: 6379 }] } instead of { host: '...', port: 6379 }. affects: >=0.14.0 <0.15.0
breakingPrior to v0.13, Queue.add() used positional arguments for options. v0.13+ requires a single options object.fixChange queue.add(name, data, opts) to queue.add(name, data, opts) as single options object.
affects: <0.13.0
deprecatedThe 'limiter' option on Worker has been renamed to 'tokenLimiter' in v0.15.fixUse { tokenLimiter: { maxTokens: 100000, duration: 60000 } } instead of { limiter: ... }. affects: >=0.15.0
gotchaWorker must be instantiated with an async function; synchronous functions will hang or throw.fixAlways use async (job) => { ... } as the processor. affects: >=0.1.0
breakingIn v0.12, Flow class was renamed from FlowProducer to Flow. Old name is removed in v0.13+.fixUse import { Flow } from 'glide-mq' instead of import { FlowProducer } from 'glide-mq'. affects: >=0.12.0 <0.13.0
gotchaWhen using Valkey clusters, all keys are hash-tagged with {queueName}, so queue names must not contain curly braces.fixEnsure queue names do not include '{' or '}' characters. affects: >=0.1.0
Errors
Common errors & fixes
Error: No addresses provided in connection
Connection object is missing 'addresses' array or is empty.
fixSet connection.addresses = [{ host: 'localhost', port: 6379 }]. TypeError: Worker is not a constructor
Using CommonJS require without .default, or wrong import syntax.
fixUse import { Worker } from 'glide-mq' (ESM) or const { Worker } = require('glide-mq') (CJS). Error: Cannot find module 'glide-mq'
Package not installed or Node version <20 (glide-mq requires >=20).
fixRun npm install glide-mq and ensure Node >=20.
Error: Flow name must be a non-empty string
Flow.add() called with an empty or missing queue name.
fixProvide a valid string queueName as the first argument to Flow.add().
Audit
Dependencies
@opentelemetry/apioptionalOptional telemetry support for tracing queue operations
expressoptionalOptional peer dependency for dashboard/webhook endpoints (>=4.18)