Classes · @purista/core
DefaultQueueBridge
In-memory queue bridge for development and unit tests.
Signature
class DefaultQueueBridgeExamples
const queueBridge = new DefaultQueueBridge({ defaultLeaseTtlMs: 60_000 })
await queueBridge.enqueue({ queueName: 'orders', payload: { id: 'ord_1' } })Constructors
1 entry
constructor
Constructor
new constructor(options?: DefaultQueueBridgeOptions)Properties
3 entries
capabilities
Property
capabilities: QueueBridgeCapabilitiesProcess-local capability matrix for strict startup validation.
instanceId
Property
instanceId: stringRuntime instance id for this in-memory bridge instance.
name
Property
name: "DefaultQueueBridge"Human-readable bridge name used in diagnostics and metrics.
Methods
15 entries
ack
Method
ack(queueName: string, leaseId: string): Promise<void>Acknowledge successful processing and remove the leased message.
destroy
Method
destroy(): Promise<void>Release provider resources and stop background bridge activity.
enqueue
Method
enqueue(options: QueueEnqueueOptions<unknown, unknown>): Promise<QueueEnqueueResult>Enqueue a queue message and return provider-visible job metadata.
extendLease
Method
extendLease(queueName: string, leaseId: string, extensionMs: number): Promise<void>Extend an active lease so long-running work can continue safely.
inspectLeases
Method
inspectLeases(_queueName: string, _options?: QueueDeadLetterListOptions): Promise<QueueLeaseInspectionRecord[]>Inspect active leases when the adapter supports lease diagnostics.
isHealthy
Method
isHealthy(): Promise<boolean>Returns whether the bridge can currently make progress.
isReady
Method
isReady(): Promise<boolean>Returns whether the bridge has completed startup and can accept calls.
leaseNext
Method
leaseNext(queueName: string, _opts?: QueueLeaseOptions): Promise<QueueLease | undefined>Lease the next available message for a worker, if one is ready.
metrics
Method
metrics(queueName: string): Promise<QueueMetrics>Return queue-level operational metrics for health and dashboards.
moveToDeadLetter
Method
moveToDeadLetter(queueName: string, message: QueueMessage, reason?: string): Promise<void>Move a message to the dead-letter store with an optional safe reason.
nack
Method
nack(queueName: string, leaseId: string, request: QueueRetryRequest): Promise<void>Return a leased message to the queue or move it toward dead-letter policy.
peekDeadLetter
Method
peekDeadLetter(queueName: string, options?: QueueDeadLetterListOptions): Promise<QueueMessage[]>Inspect dead-letter messages without redriving or deleting them.
purgeDeadLetter
Method
purgeDeadLetter(queueName: string): Promise<number>Delete all dead-letter messages for the queue.
redriveDeadLetter
Method
redriveDeadLetter(queueName: string, options?: QueueDeadLetterRedriveOptions): Promise<number>Move dead-letter messages back to the live queue.
start
Method
start(): Promise<void>Start the bridge and establish any provider connection needed for work.