/** * Redis Streams distributed job queue. * * Provides horizontal crawler scaling via Redis Streams consumer groups. * Multiple crawler nodes can pull from the same stream — each job is * delivered to exactly one consumer (at-least-once via ACK/PENDING). * * Used when REDIS_URL is set AND JOB_QUEUE_BACKEND=redis. * Falls back to the Postgres-backed queue when Redis is unavailable. * * Stream key: zeta:crawl:stream * Group name: zeta:crawl:workers * Consumer id: zeta:worker:: */ export interface RedisQueueJob { id: string; jobId: string; tenantId: string; projectId: string; payload: Record; enqueuedAt: string; } export interface RedisQueueClient { enqueue(jobId: string, tenantId: string, projectId: string, payload?: Record): Promise; dequeue(timeoutMs?: number): Promise; ack(streamEntryId: string): Promise; nack(streamEntryId: string): Promise; reclaimStale(maxIdleMs?: number): Promise; stats(): Promise<{ pending: number; delivered: number; groupLag: number; }>; close(): Promise; } /** * Create a Redis Streams job queue client. * Throws if REDIS_URL is not set. */ export declare function createRedisQueue(): Promise; /** * Check if Redis queue backend is configured. */ export declare function isRedisQueueEnabled(): boolean; /** * Convenience: create queue only if enabled, else return null. */ export declare function maybeCreateRedisQueue(): Promise;