Skip to content

Instantly share code, notes, and snippets.

@SiestaMadokaist
Last active April 29, 2025 16:13
Show Gist options
  • Save SiestaMadokaist/8d72b3b5fbfe6d4bd897467fbe768353 to your computer and use it in GitHub Desktop.
Save SiestaMadokaist/8d72b3b5fbfe6d4bd897467fbe768353 to your computer and use it in GitHub Desktop.
action-queue
interface IActionQueue<T> {
jobId: string; // primary key
currentStatus: 'pending' | 'running' | 'completed' | 'cancelled'; // GSI PK
priorityScore: number; // timestamp, GSI SK (default value = createdAt) can be overriden.
createdAt: number; // the real createdAt (although not really)
resource: T;
}
// IPromptParam = { seed, sampler, prompt, negative, n_iter, ... }
interface IGenerateQueue extends IActionQueue<IPromptParam[]> {
progressDone: number;
totalWork: number;
}
// IFetchParam = { source, protocol: 's3' | 'http', type: 'checkpoint' | 'lora' }
interface IFetchQueue extends IActionQueue<IFetchParam> { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment