@aaswe/codebase-ai
Version:
AI-Assisted Software Engineering (AASWE) - Rich codebase context for IDE LLMs
79 lines • 2.17 kB
TypeScript
/**
* Ingestion Job Queue
* Manages batch processing and job scheduling for code ingestion
*/
import { EventEmitter } from 'events';
import { IngestionJob, IngestionJobType, JobStatus, JobPriority, JobProgress, IngestionJobMetadata, IngestionConfig } from './types';
export declare class IngestionJobQueue extends EventEmitter {
private jobs;
private runningJobs;
private config;
private processingInterval?;
constructor(config?: Partial<IngestionConfig>);
/**
* Initialize the job queue
*/
initialize(): Promise<void>;
/**
* Add a new ingestion job to the queue
*/
addJob(repositoryId: string, type: IngestionJobType, metadata: IngestionJobMetadata, priority?: JobPriority): Promise<IngestionJob>;
/**
* Cancel a job
*/
cancelJob(jobId: string): Promise<void>;
/**
* Get job by ID
*/
getJob(jobId: string): IngestionJob | undefined;
/**
* Get all jobs for a repository
*/
getRepositoryJobs(repositoryId: string): IngestionJob[];
/**
* Get jobs by status
*/
getJobsByStatus(status: JobStatus): IngestionJob[];
/**
* Get queue statistics
*/
getQueueStats(): {
total: number;
pending: number;
running: number;
completed: number;
failed: number;
cancelled: number;
};
/**
* Update job progress
*/
updateJobProgress(jobId: string, progress: Partial<JobProgress>): void;
/**
* Mark job as completed
*/
completeJob(jobId: string): void;
/**
* Mark job as failed
*/
failJob(jobId: string, error: string): void;
/**
* Retry a failed job
*/
retryJob(jobId: string): Promise<void>;
/**
* Clear completed and failed jobs older than specified time
*/
cleanup(olderThanHours?: number): void;
/**
* Shutdown the job queue
*/
shutdown(): Promise<void>;
private startProcessing;
private processNextJob;
private startJob;
private getPriorityWeight;
private setupCleanup;
}
export default IngestionJobQueue;
//# sourceMappingURL=IngestionJobQueue.d.ts.map