@zowe/imperative
Version:
framework for building configurable CLIs
32 lines • 1.35 kB
TypeScript
import type { IQueueThrottleOptions } from "./doc/IQueueThrottleOptions";
export declare class Queue {
private readonly defaultQueue;
private mQueueTimeout;
private mMaxConcurrentRequests;
private mQueue;
constructor(options?: IQueueThrottleOptions);
/**
* Changes an existing request queue's throttling options.
* @param options - The throttling options to apply to the request queue.
* @throws {ImperativeError} - when the options provided are out of bounds.
*/
setThrottlingOptions(options: IQueueThrottleOptions): void;
/**
* Add a promise to the queue
* @param promiseFunction The promise, bound with all arguments, to execute on its turn in the queue.
* @param poolId The queue pool that the promise should execute against
* @returns The promise of the promiseFunction
*/
enqueue<T>(promiseFunction: Function, poolId?: string): Promise<T>;
/**
* Removes an item from the queue, checks if it times out, and executes the promise if valid
* @param queue The pool of promises to execute against
*/
private dequeue;
/**
* Creates a new queue with the provided name. If none is provided, creates a "default" queue/
* @param name The name of the queue to create
*/
private createQueue;
}
//# sourceMappingURL=Queue.d.ts.map