/** * Queue Management Redis Keys * * Key builder functions for the Queue Management System. * These are ONLY for operational queue control. * * NOTE: Game/market pause is checked via existing searchGames()/searchMarkets() * which return game.paused/market.paused from Redis Search cache. * DO NOT create separate pause keys for games/markets. */ import type { QueueType } from "./types"; export declare const QueueManagementKeys: { readonly pause: { /** * Global pause key - stops ALL queue processing * Type: STRING (JSON) * @example 'queue:pause:global' */ readonly global: () => "queue:pause:global"; /** * Queue type pause key - stops all queues of a specific type * Type: STRING (JSON) * @example 'queue:pause:type:market' */ readonly type: (type: QueueType) => "queue:pause:type:game" | "queue:pause:type:game_time" | "queue:pause:type:liquidation" | "queue:pause:type:market"; /** * Individual queue pause key - stops a specific queue * Type: STRING (JSON) * Use for operational control without touching game/market state * @example 'queue:pause:queue:mkt.507f1f77bcf86cd799439011.507f1f77bcf86cd799439012' */ readonly queue: (queueName: string) => `queue:pause:queue:${string}`; /** * Active operational pauses index * Type: SET * Members: All currently paused key names (only operational pauses) * @example 'queue:pause:active' */ readonly activeIndex: () => "queue:pause:active"; }; readonly escalation: { /** * Queue escalation state * Type: HASH * @example 'queue:escalation:mkt.abc.xyz' */ readonly state: (queueName: string) => `queue:escalation:${string}`; /** * Queue escalation history * Type: LIST (LPUSH, most recent first) * @example 'queue:escalation:history:mkt.abc.xyz' */ readonly history: (queueName: string) => `queue:escalation:history:${string}`; /** * Active escalations index (sorted by level) * Type: SORTED SET (score = escalation level) * @example 'queue:escalation:active' */ readonly activeIndex: () => "queue:escalation:active"; }; readonly circuitBreaker: { /** * Circuit breaker state for a queue * Type: HASH * @example 'circuit_breaker:mkt.abc.xyz' */ readonly state: (queueName: string) => `circuit_breaker:${string}`; /** * Index of open circuit breakers * Type: SET * @example 'circuit_breaker:open' */ readonly openIndex: () => "circuit_breaker:open"; }; readonly dlq: { /** * DLQ statistics cache * Type: HASH * TTL: 60 seconds * @example 'dlq:stats:dlq.market' */ readonly stats: (dlqName: string) => `dlq:stats:${string}`; /** * DLQ reprocess counter * Type: STRING (integer) * @example 'dlq:reprocessed:dlq.market' */ readonly reprocessCount: (dlqName: string) => `dlq:reprocessed:${string}`; /** * DLQ alert sent flag (for debouncing) * Type: STRING * TTL: 3600 seconds (1 hour) * @example 'dlq:alert:dlq.market:threshold_exceeded' */ readonly alertSent: (dlqName: string, alertType: string) => `dlq:alert:${string}:${string}`; }; };