UNPKG

@hisorange/resistor

Version:

Versatily resource load throttler with extensible strategies, configuration and virtual thread management.

17 lines (16 loc) 581 B
import { IStrategy } from '../interfaces/strategy.interface'; import { WaitPass } from '../interfaces/wait-pass.interface'; interface IIntervalConfig { interval: number; } /** * Respecting the minimum delay between executions. */ export declare class IntervalStrategy implements IStrategy { protected monitor: Map<number, number>; protected config: IIntervalConfig; constructor(config: Partial<IIntervalConfig>); handleWaitPass(threadId: number, waitPass: WaitPass): Promise<void>; threadFinished(threadId: number, finishedAt: number): void; } export {};