X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FPoolEmitter.html;h=9c98d578745e86146015c9206ea6bf989abf7fca;hb=f2d2c4a40a1d1652ba5fb0dee4b6aa3387321c92;hp=5d097d487c38d2bb19370a724de5d7ca3957faea;hpb=3db479d12e6d8dff22ca35537d96af8d6830ff13;p=poolifier.git diff --git a/docs/classes/PoolEmitter.html b/docs/classes/PoolEmitter.html index 5d097d48..9c98d578 100644 --- a/docs/classes/PoolEmitter.html +++ b/docs/classes/PoolEmitter.html @@ -1,4 +1,4 @@ -PoolEmitter | poolifier - v2.6.14
+PoolEmitter | poolifier - v2.6.34
  • Preparing search index...
  • -
  • The search index is not available
poolifier - v2.6.14
+
  • The search index is not available
  • poolifier - v2.6.34
    @@ -26,7 +26,7 @@
    • PoolEmitter
    +
  • Defined in src/pools/pool.ts:39
  • @@ -60,7 +60,9 @@ removeAllListeners removeListener setMaxListeners +addAbortListener getEventListeners +getMaxListeners listenerCount on once @@ -81,7 +83,7 @@

    Returns PoolEmitter

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:109
  • Properties

    @@ -95,7 +97,7 @@
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:390
  • captureRejections: boolean
    @@ -107,7 +109,7 @@
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:397
  • defaultMaxListeners: number
    @@ -138,7 +140,7 @@ Its name property is set to 'MaxListenersExceededWarning&
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:434
  • errorMonitor: typeof errorMonitor
    @@ -151,7 +153,7 @@ regular 'error' listener is installed.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:383
  • Methods

    @@ -185,7 +187,7 @@ regular 'error' listener is installed.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:454
    • @@ -210,7 +212,7 @@ to each.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:716
    • @@ -227,7 +229,7 @@ listeners. The values in the array are strings or Symbols.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:779
  • +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:631
    • @@ -271,7 +273,7 @@ in the list of the listeners of the event.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:725
    • @@ -292,7 +294,7 @@ in the list of the listeners of the event.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:644
    • @@ -324,7 +326,7 @@ in the list of the listeners of the event.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:604
    • @@ -372,7 +374,7 @@ event listener to the beginning of the listeners array.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:486
    • @@ -418,7 +420,7 @@ event listener to the beginning of the listeners array.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:516
    • @@ -462,7 +464,7 @@ times.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:743
    • @@ -504,7 +506,7 @@ listener is removed, and then invoked.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:759
    • @@ -526,7 +528,7 @@ including any wrappers (such as those created by .once()).

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:675
    • @@ -549,7 +551,7 @@ component or module (e.g. sockets or file streams).

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:615
    • @@ -603,7 +605,7 @@ recently added instance. In the example the once('ping')lis
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:599
    • @@ -626,7 +628,51 @@ modified for this specific EventEmitter instance. The value can be
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:625
  • +
    + +
      + +
    • Experimental +

      Listens once to the abort event on the provided signal.

      +

      Listening to the abort event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call e.stopImmediatePropagation(). Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners.

      +

      This API allows safely using AbortSignals in Node.js APIs by solving these +two issues by listening to the event such that stopImmediatePropagation does +not prevent the listener from running.

      +

      Returns a disposable so that it may be unsubscribed from more easily.

      +
      import { addAbortListener } from 'node:events';

      function example(signal) {
      let disposable;
      try {
      signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
      disposable = addAbortListener(signal, (e) => {
      // Do something when signal is aborted.
      });
      } finally {
      disposable?.[Symbol.dispose]();
      }
      } +
      +
      +
      +

      Parameters

      +
        +
      • +
        signal: AbortSignal
      • +
      • +
        resource: ((event) => void)
        +
          +
        • +
            +
          • (event): void
          • +
          • +
            +

            Parameters

            +
              +
            • +
              event: Event
            +

            Returns void

      +

      Returns Disposable

      that removes the abort listener.

      + +
      +

      Since

      v20.5.0

      +
      @@ -653,7 +699,33 @@ event target. This is useful for debugging and diagnostic purposes.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:296
  • +
    + +
      + +
    • +

      Returns the currently set max amount of listeners.

      +

      For EventEmitters this behaves exactly the same as calling .getMaxListeners on +the emitter.

      +

      For EventTargets this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning.

      +
      import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';

      {
      const ee = new EventEmitter();
      console.log(getMaxListeners(ee)); // 10
      setMaxListeners(11, ee);
      console.log(getMaxListeners(ee)); // 11
      }
      {
      const et = new EventTarget();
      console.log(getMaxListeners(et)); // 10
      setMaxListeners(11, et);
      console.log(getMaxListeners(et)); // 11
      } +
      +
      +
      +

      Parameters

      +
        +
      • +
        emitter: EventEmitter | _DOMEventTarget
      +

      Returns number

      +
      +

      Since

      v19.9.0

      +
      @@ -684,7 +756,7 @@ event target. This is useful for debugging and diagnostic purposes.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:268
    • @@ -719,7 +791,7 @@ composed of the emitted event arguments.

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:250
    • @@ -757,7 +829,7 @@ special handling:

      +
    • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:189
  • @@ -772,7 +844,7 @@ special handling:

    Returns Promise<any[]>

  • +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:190
    • @@ -797,7 +869,7 @@ special handling:

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.4/node_modules/@types/node/events.d.ts:340