1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 22:33:17 +00:00
musix-oss/node_modules/m3u8stream/dist/queue.d.ts

32 lines
700 B
TypeScript
Raw Normal View History

2020-03-03 20:30:50 +00:00
declare type Callback = (err?: Error, result?: any) => void;
interface Task {
item: {};
callback: Callback;
}
export default class Queue {
_worker: (item: any, cb: Callback) => void;
_concurrency: number;
tasks: Task[];
total: number;
active: number;
/**
* A really simple queue with concurrency.
*/
constructor(worker: (item: any, cb: Callback) => void, options?: {
concurrency?: number;
});
/**
* Push a task to the queue.
*/
push(item: any, callback?: Callback): void;
/**
* Process next job in queue.
*/
_next(): void;
/**
* Stops processing queued jobs.
*/
die(): void;
}
export {};