UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

65 lines 1.45 kB
export class OnDemandWorkerManager { /** * * @param {WorkerProxy} worker */ constructor(worker: WorkerProxy); /** * Number of active pending requests * @type {number} * @private */ private __request_count; /** * How long to wait before terminating the worker after it becomes idle * in milliseconds * @type {number} * @private */ private __timeout; /** * ID of the timer set via setTimeout * @type {number} * @private */ private __pending_termination; /** * @type {WorkerProxy} */ worker: WorkerProxy; /** * Configure how long to wait after processing a request until deciding to shut down the worker * @param {number} delay_ms In milliseconds */ setTimeout(delay_ms: number): void; /** * @private */ private terminate; /** * @private */ private cancelScheduledTermination; /** * * @param {number} timeout */ scheduleTermination(timeout: number): void; /** * @private */ private decrement; /** * @private */ private increment; /** * Submit request to the worker * @template T * @param {string} name * @param {Array} [parameters] * @return {Promise<T>} */ request<T>(name: string, parameters?: any[]): Promise<T>; } //# sourceMappingURL=OnDemandWorkerManager.d.ts.map