chore: generate documentation
[poolifier.git] / src / pools / pool.ts
index 8a5e505f4f2d23909db36ef3d66e987eee9e9afd..f1da5356a2e5310d799b6e595a898a3aad783600 100644 (file)
@@ -12,6 +12,19 @@ import type { WorkerChoiceStrategy } from './selection-strategies/selection-stra
  */
 export class PoolEmitter extends EventEmitter {}
 
+/**
+ * Enumeration of pool events.
+ */
+export const PoolEvents = Object.freeze({
+  full: 'full',
+  busy: 'busy'
+} as const)
+
+/**
+ * Pool event.
+ */
+export type PoolEvent = keyof typeof PoolEvents
+
 /**
  * Options for a poolifier pool.
  */
@@ -56,7 +69,8 @@ export interface IPool<Data = unknown, Response = unknown> {
    *
    * Events that can currently be listened to:
    *
-   * - `'busy'`
+   * - `'full'`: Emitted when the pool is dynamic and full.
+   * - `'busy'`: Emitted when the pool is busy.
    */
   readonly emitter?: PoolEmitter
   /**