glide-mq
Classes
| Class | Description |
|---|---|
| BatchError | Thrown by batch processors to report per-job results (mixed success/failure). |
| Broadcast | Broadcast - Fan-out message publisher for pub/sub patterns. |
| BroadcastWorker | - |
| ConnectionError | Thrown when a Valkey/Redis connection cannot be established. |
| CycleError | - |
| DelayedError | Internal control-flow error thrown by job.moveToDelayed(). Caught by the Worker. |
| FlowProducer | Creates parent-child job flows and DAG workflows. Children are processed first; the parent runs after all children complete. |
| GlideMQError | Base error class for all glide-mq errors. |
| GroupRateLimitError | Internal control-flow error thrown by job.rateLimitGroup(). Caught by the Worker. |
| Job | Represents a single job in the queue. Provides methods for reporting usage, streaming chunks, managing state, and interacting with the job lifecycle (delay, suspend, retry, etc.). |
| Producer | - |
| Queue | Queue manages job submission, retrieval, scheduling, and lifecycle operations. Connects to Valkey/Redis and uses server-side functions for atomic operations. |
| QueueEvents | - |
| ServerlessPool | - |
| SuspendError | Internal control-flow error thrown by job.suspend(). Caught by the Worker. |
| UnrecoverableError | Thrown to signal a job failure that should never be retried, regardless of attempts config. |
| WaitingChildrenError | Internal control-flow error thrown by job.moveToWaitingChildren(). Caught by the Worker. |
| Worker | - |
Interfaces
| Interface | Description |
|---|---|
| AddAndWaitOptions | Options for Queue.addAndWait(). Extends JobOptions with a wait timeout. |
| BatchOptions | Configuration for batch processing mode. |
| BroadcastOptions | Configuration options for a Broadcast (pub/sub) queue. |
| BroadcastWorkerOptions | Configuration options for a BroadcastWorker (subscriber). |
| BudgetOptions | Budget constraints for a flow. Caps token usage and/or cost across all jobs. |
| ConnectionOptions | Options for connecting to a Valkey/Redis server or cluster. |
| DAGFlow | A complete DAG flow definition for submission via FlowProducer.addDAG(). |
| DAGNode | A node in a DAG flow. Each node is a job with optional dependencies on other nodes. The deps array lists the names of nodes that must complete before this node can run. |
| DeadLetterQueueOptions | Configuration for dead letter queue routing. |
| FlowJob | Definition of a job within a flow (parent-child hierarchy). |
| FlowProducerOptions | Configuration options for creating a FlowProducer instance. |
| GetJobsOptions | Options for getJob() and getJobs() methods. |
| GroupRateLimitOptions | Options controlling behavior when job.rateLimitGroup() is called. |
| IamCredentials | IAM authentication credentials for AWS ElastiCache/MemoryDB. |
| IndexCreateOptions | Options passed through to FT.CREATE (glide-mq owned, decoupled from speedkey). |
| JobCounts | Count of jobs in each state. |
| JobData | Generic job data payload type. |
| JobIndexOptions | Options for creating a Valkey Search index over job hashes. |
| JobNode | - |
| JobOptions | Options for controlling individual job behavior (delay, priority, retry, etc.). |
| JobTemplate | Template for jobs created by a scheduler. |
| JobUsage | AI-specific usage metadata reported by a job processor. |
| Metrics | Aggregated metrics result with total count and per-minute data points. |
| MetricsDataPoint | A single per-minute metrics data point. |
| MetricsOptions | Options for querying metrics data points. |
| PasswordCredentials | Standard password-based credentials. |
| ProducerOptions | - |
| QueueEventsOptions | Configuration options for creating a QueueEvents listener. |
| QueueOptions | Configuration options for creating a Queue instance. |
| RateLimitConfig | Configuration for time-window rate limiting. |
| ReadStreamOptions | Options for readStream() - reading entries from a job's streaming channel. |
| SandboxOptions | Options for sandboxed (file-path) processors running in worker threads or child processes. When a job's abort signal fires (timeout or revocation), the abort is forwarded to the processor. If it has not settled 5 seconds later, its worker thread is terminated (or its child process is SIGKILLed) and replaced, so a hung processor cannot hold a sandbox slot. During that window the worker no longer owns the job: job.updateProgress(), job.updateData() and job.moveToDelayed() reject with Job aborted; job.log() still works. |
| ScheduleOpts | Options for defining a job schedule (cron, interval, or repeat-after-complete). |
| SchedulerEntry | Stored state of a registered job scheduler. |
| SearchJobsOptions | Options for searchJobs() method. |
| SearchQueryOptions | Options passed through to FT.SEARCH (glide-mq owned, decoupled from speedkey). |
| Serializer | Custom serializer for job data and return values. |
| SignalEntry | A signal entry delivered to a suspended job on resume. |
| SuspendOptions | Options for suspending a job. |
| TokenBucketConfig | Configuration for token bucket rate limiting with burst capacity and refill rate. |
| UsageQueueSummary | Aggregated usage totals for a single queue inside a usage summary response. |
| UsageSummary | Rolling aggregate usage summary across one or more queues. |
| UsageSummaryOptions | Options for aggregating reported usage across one or more queues. |
| VectorSearchOptions | Options for vector similarity search over indexed jobs. |
| VectorSearchResult | A single result from a vector similarity search. |
| WorkerInfo | Information about a live worker instance. |
| WorkerOptions | Configuration options for creating a Worker instance. Extends QueueOptions. |
| WorkflowJobDef | - |
Type Aliases
| Type Alias | Description |
|---|---|
| BatchProcessor | - |
| ClosableWorkflow | Returned workflow tree or DAG map plus close() for an injected client. |
| Field | - |
| GracefulShutdownHandle | - |
| Processor | - |
| ReadFrom | Represents the client's read from strategy. |
| WorkflowConnection | Connection for helpers. Pass client to keep returned jobs usable. |
Variables
| Variable | Description |
|---|---|
| JSON_SERIALIZER | Default JSON serializer used when no custom serializer is provided. |
| serverlessPool | Module-level singleton for convenient use in serverless handlers. |
Functions
| Function | Description |
|---|---|
| chain | Chain: execute jobs sequentially. Each step becomes a child of the next, so step N+1 only runs after step N completes. The last job in the array runs first; the first job in the array runs last and is the top-level parent. |
| chord | Chord: run a group of jobs in parallel, then execute a callback job with the results. The callback is the parent, the group members are children. |
| compileSubjectMatcher | Compile an array of subject patterns into a single matcher function. Returns a function that returns true if the subject matches any pattern. Returns null if patterns is empty or undefined (no filtering). |
| dag | DAG: submit a directed acyclic graph of jobs where each job can depend on multiple other jobs. The graph is validated for cycles and submitted in topological order (leaves first). |
| gracefulShutdown | Register SIGTERM and SIGINT handlers that gracefully close all provided components. Returns a Promise that resolves when all components have been closed. A second signal while shutdown is still running removes these handlers and re-raises that signal, so the process gets its default handling (exit) instead of the signal being swallowed behind a hung close(). |
| group | Group: execute jobs in parallel. All jobs run concurrently. A synthetic parent job (name: 'group') waits for all children. When complete, the parent's processor receives all children's results via getChildrenValues(). |
| isClusterClient | Detect whether a client is a GlideClusterClient. Uses instanceof with a duck-type fallback for cases where the client comes from a different copy/version of @glidemq/speedkey (dependency duplication). |
| isTracingEnabled | True when a real OTel API is available (either user-provided or auto-detected). |
| matchSubject | Match a dot-separated subject against a pattern. - * matches exactly one segment - > matches one or more trailing segments (must be the last token) - Literal tokens match exactly |
| setTracer | Allow the user to supply their own tracer instance. If not called, the tracer is auto-resolved from @opentelemetry/api. |
| topoSort | Topological sort of DAG nodes using Kahn's algorithm. Returns nodes in submission order (leaves first, roots last). Throws CycleError if a cycle is detected. |
| validateDAG | Validate that a set of DAG nodes forms a valid DAG (no cycles). Throws CycleError if a cycle is detected. Throws Error if a node references a non-existent dependency. |