Complete Documentation

Documentation& Guides

Everything you need to know about Reliable Queue. From basic usage to advanced configurations, we've got you covered with comprehensive guides and examples.

Quick Start Guide

Get up and running in minutes

Follow these simple steps to integrate Reliable Queue into your application and start processing tasks reliably.

1

Install the Package

Add Reliable Queue to your project using npm or yarn.

Step 1
bash
npm install @aplanka/reliable-queue
2

Create a Queue

Set up a queue with your desired configuration and task processor.

Step 2
typescript
import { ReliableQueue } from '@aplanka/reliable-queue';
// Create a basic queue
const queue = new ReliableQueue({
maxRetries: 3,
retryDelay: 1000,
exponentialBackoff: true,
});
// Set up task processor
queue.setProcessor(async (data) => {
console.log('Processing:', data);
// Your async task logic here
const result = await processTask(data);
return result;
});
// Add tasks
queue.add({ id: 1, action: 'process-data' });
queue.add({ id: 2, action: 'send-email' });
3

React Integration

Use the React hook for seamless integration with your React components.

Step 3
tsx
import React from 'react';
import { useReliableQueue } from '@aplanka/reliable-queue';
function TaskManager() {
const { tasks, stats, addTask, retryTask } = useReliableQueue({
queueName: 'my-tasks',
maxRetries: 3,
processor: async (task) => {
// Process your task
await fetch('/api/process', {
method: 'POST',
body: JSON.stringify(task),
});
},
});
return (
<div>
<div>Pending: {stats.pending}, Failed: {stats.failed}</div>
<button onClick={() => addTask({ data: 'test' })}>
Add Task
</button>
{tasks.map(task => (
<div key={task.id}>
{task.status} - {JSON.stringify(task.data)}
{task.status === 'failed' && (
<button onClick={() => retryTask(task.id)}>Retry</button>
)}
</div>
))}
</div>
);
}
Ready to Build

Start building reliable applications today

Check out our examples and interactive demo to see Reliable Queue in action. From simple use cases to complex workflows, we've got you covered.

Production Ready
TypeScript First
Zero Dependencies