Queue Dashboard
Built-in web dashboard for monitoring and managing your background job queues. Inspired by Laravel Horizon, the Queue Dashboard provides real-time visibility into your job processing pipeline.
Real-time Stats
Monitor pending, failed, and processed job counts at a glance
Job Management
View pending and failed jobs with full payload details
Retry Failed Jobs
One-click retry for failed jobs directly from the dashboard
Clear Queue
Quickly clear all jobs when needed for development or reset
Quick Setup
Mount the Queue Dashboard in your application with just a few lines of code. The dashboard will be available at /canx-queue.
1import { createApp, queue, QueueController } from "canxjs";23const app = createApp({ port: 3000 });45// Mount the Queue Dashboard at /canx-queue6app.routes((router) => {7router.controller('/canx-queue', QueueController);8});910app.listen();
Working with Jobs
Dispatch background jobs to queues and process them asynchronously. Jobs can be immediate or delayed.
1import { queue } from "canxjs";23// Dispatch a job to the queue4await queue.dispatch("send-email", {5to: "user@example.com",6subject: "Welcome!",7body: "Thank you for signing up."8});910// Dispatch with delay (5 minutes)11await queue.later("send-reminder", { userId: 123 }, 300);1213// Process jobs14queue.process("send-email", async (job) => {15await sendEmail(job.data);16console.log(`Email sent to ${job.data.to}`);17});
Queue API
Programmatically interact with the queue using the Queue API. Get statistics, manage failed jobs, and more.
1// Get queue statistics2const stats = await queue.getStats();3console.log(stats);4// { pending: 12, failed: 2, processed: 158 }56// Get failed jobs7const failedJobs = await queue.getFailed();89// Retry a specific job10await queue.retry(jobId);1112// Clear all jobs13await queue.clear();
Dashboard API Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /canx-queue/api/stats | Get queue statistics |
GET | /canx-queue/api/jobs/failed | List failed jobs |
GET | /canx-queue/api/jobs/pending | List pending jobs |
POST | /canx-queue/api/jobs/retry/:id | Retry a failed job |
POST | /canx-queue/api/clear | Clear all jobs |
Queue Drivers
Memory Driver
Default driver, perfect for development and testing. Jobs are stored in memory.
MemoryDriverRedis Driver
Production-ready driver with persistence. Requires Redis server.
RedisDriver