/**
 * Queue task types
 */

import type { TaskContext } from "../../valkey/types";

/**
 * Queued task interface
 * Priority: 1-10 (higher = more important)
 */
export interface QueuedTask {
  taskId: string;
  priority: number; // 1-10
  retries: number;
  maxRetries: number;
  context: TaskContext;
}

/**
 * Queue monitoring statistics
 */
export interface QueueStats {
  pending: number;
  active: number;
  completed: number;
  failed: number;
  delayed: number;
}

/**
 * Queue options for adding tasks
 */
export interface AddTaskOptions {
  priority?: number; // 1-10, default 5
  maxRetries?: number; // default 3
  delay?: number; // delay in milliseconds before processing
}

/**
 * Retry configuration
 */
export interface RetryConfig {
  maxRetries: number;
  baseDelay: number; // base delay in milliseconds
  maxDelay: number; // maximum delay cap
}

/**
 * Task processing result
 */
export interface TaskProcessingResult {
  success: boolean;
  error?: string;
  metadata?: Record<string, unknown>;
}
