Skip to content

PURISTA API


PURISTA API / @purista/redis-queue-bridge

@purista/redis-queue-bridge

A pull-based queue bridge that persists jobs inside Redis lists. It implements the QueueBridge interface from @purista/core and exposes the same leasing semantics as the default in-memory bridge.

  • FIFO semantics backed by LPUSH/BRPOPLPUSH
  • Delayed delivery via a Redis sorted set
  • Lease renewal + crash recovery using per-lease bookkeeping
  • Dead-letter queue stored in Redis for later inspection
  • Strict idempotency enforcement for stable enqueue keys

When idempotencyKey is provided, Redis stores the original enqueue result atomically with the job. Repeating enqueue for the same queue and key returns the original jobId and does not create another job. Missing keys keep normal enqueue behavior.

Usage

ts
import { RedisQueueBridge } from '@purista/redis-queue-bridge'

const queueBridge = new RedisQueueBridge({
	config: {
		url: 'redis://127.0.0.1:6379'
	}
})

Inject the bridge into a service via ServiceBuilder.defineResource('queueBridge', queueBridge) or provide it during service construction.

Classes

Type Aliases