X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIWorker.html;h=78e1b25c3b27a0839d9a0050dea99c2a507c81f0;hb=186417b2eb79b9bcadbf15bd5c53da4dbe6c92e2;hp=fd827e70bb387e0fd9b2903ae501567620d9ead9;hpb=23919b9e65a6ac78db29d8309aec261fffe36bb1;p=poolifier.git diff --git a/docs/interfaces/IWorker.html b/docs/interfaces/IWorker.html index fd827e70..78e1b25c 100644 --- a/docs/interfaces/IWorker.html +++ b/docs/interfaces/IWorker.html @@ -1,5 +1,5 @@ -IWorker | poolifier - v4.0.8

Interface IWorker

Worker interface.

-
interface IWorker {
    disconnect?: (() => void);
    id?: number;
    kill?: ((signal?) => void);
    on: ((event, handler) => this);
    once: ((event, handler) => this);
    terminate?: (() => Promise<number>);
    threadId?: number;
    unref?: (() => void);
    [captureRejectionSymbol]?<K>(error, event, ...args): void;
    addListener<K>(eventName, listener): this;
    emit<K>(eventName, ...args): boolean;
    eventNames(): (string | symbol)[];
    getMaxListeners(): number;
    listenerCount<K>(eventName, listener?): number;
    listeners<K>(eventName): Function[];
    off<K>(eventName, listener): this;
    prependListener<K>(eventName, listener): this;
    prependOnceListener<K>(eventName, listener): this;
    rawListeners<K>(eventName): Function[];
    removeAllListeners(eventName?): this;
    removeListener<K>(eventName, listener): this;
    setMaxListeners(n): this;
}

Hierarchy

  • EventEmitter
    • IWorker

Properties

disconnect? +IWorker | poolifier - v4.0.10

Interface IWorker

Worker interface.

+
interface IWorker {
    disconnect?: (() => void);
    id?: number;
    kill?: ((signal?) => void);
    on: ((event, handler) => this);
    once: ((event, handler) => this);
    terminate?: (() => Promise<number>);
    threadId?: number;
    unref?: (() => void);
    [captureRejectionSymbol]?<K>(error, event, ...args): void;
    addListener<K>(eventName, listener): this;
    emit<K>(eventName, ...args): boolean;
    eventNames(): (string | symbol)[];
    getMaxListeners(): number;
    listenerCount<K>(eventName, listener?): number;
    listeners<K>(eventName): Function[];
    off<K>(eventName, listener): this;
    prependListener<K>(eventName, listener): this;
    prependOnceListener<K>(eventName, listener): this;
    rawListeners<K>(eventName): Function[];
    removeAllListeners(eventName?): this;
    removeListener<K>(eventName, listener): this;
    setMaxListeners(n): this;
}

Hierarchy

  • EventEmitter
    • IWorker

Properties

Properties

disconnect?: (() => void)

Cluster worker disconnect.

-

Type declaration

    • (): void
    • Returns void

id?: number

Cluster worker id.

-
kill?: ((signal?) => void)

Cluster worker kill.

-

Type declaration

    • (signal?): void
    • Parameters

      • Optional signal: string

      Returns void

on: ((event, handler) => this)

Registers an event handler.

+

Type declaration

    • (): void
    • Returns void

id?: number

Cluster worker id.

+
kill?: ((signal?) => void)

Cluster worker kill.

+

Type declaration

    • (signal?): void
    • Parameters

      • Optional signal: string

      Returns void

on: ((event, handler) => this)

Registers an event handler.

Type declaration

    • (event, handler): this
    • Parameters

      Returns this

once: ((event, handler) => this)

Registers once an event handler.

+

Returns this

once: ((event, handler) => this)

Registers once an event handler.

Type declaration

    • (event, handler): this
    • Parameters

      Returns this

terminate?: (() => Promise<number>)

Stop all JavaScript execution in the worker thread as soon as possible. +

Returns this

terminate?: (() => Promise<number>)

Stop all JavaScript execution in the worker thread as soon as possible. Returns a Promise for the exit code that is fulfilled when the 'exit' event is emitted.

-

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

threadId?: number

Worker thread worker id.

-
unref?: (() => void)

Calling unref() on a worker allows the thread to exit if this is the only +

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

threadId?: number

Worker thread worker id.

+
unref?: (() => void)

Calling unref() on a worker allows the thread to exit if this is the only active handle in the event system. If the worker is already unref()ed callingunref() again has no effect.

Type declaration

    • (): void
    • Returns void

Since

v10.5.0

-

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest ...args: AnyRest

    Returns void

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest ...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

    Since

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    @@ -123,4 +123,4 @@ memory leaks. The emitter.setMaxListeners() method allows the limit modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

    Returns a reference to the EventEmitter, so that calls can be chained.

    Parameters

    • n: number

    Returns this

    Since

    v0.3.5

    -
\ No newline at end of file +
\ No newline at end of file