Registry / ai-ml / glide-mq

glide-mq

JSON →
library0.15.3jsnpmunverified

High-performance message queue for Node.js (v0.15.3) built on Valkey/Redis Streams with Rust NAPI bindings via valkey-glide, achieving 1 RTT per job through server-side function calls (FCALL). Actively maintained with weekly releases. Differentiators include AI-native primitives (cost tracking, token streaming, model failover, budget caps, human-in-the-loop suspend/resume, TPM rate limiting, vector search), hash-tag clustering for zero-config Valkey clusters, and up to 38% higher throughput than Bull/BullMQ. Ships TypeScript types, requires Node >=20, and has optional peer dependencies on OpenTelemetry and Express.

npm install glide-mq
INSTALL
IMPORT
SIG · GLIDE-MQ
G
glide-mq
ai-mljavascriptv0.15.3
harness data pending
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.
fix
Use { 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.
fix
Change 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.
fix
Use { 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.
fix
Always 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+.
fix
Use 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.
fix
Ensure 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.
fix
Set connection.addresses = [{ host: 'localhost', port: 6379 }].
TypeError: Worker is not a constructor
Using CommonJS require without .default, or wrong import syntax.
fix
Use 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).
fix
Run 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.
fix
Provide a valid string queueName as the first argument to Flow.add().
Upgrade
Version history
0.15.3latest on npm
Audit
Dependencies
@opentelemetry/apioptionalOptional telemetry support for tracing queue operations
expressoptionalOptional peer dependency for dashboard/webhook endpoints (>=4.18)
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources