X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIWorker.html;h=1451cc9199277ed3c0c1463a447c3d82e20c5d32;hb=07aa795cd0a07537d76394f1c310304539f1237c;hp=bf3e8c712a5187af1575bfeb2ad77071ef03c33a;hpb=7088591c33a2237d4c5f5160a32de3061f983fe2;p=poolifier.git diff --git a/docs/interfaces/IWorker.html b/docs/interfaces/IWorker.html index bf3e8c71..1451cc91 100644 --- a/docs/interfaces/IWorker.html +++ b/docs/interfaces/IWorker.html @@ -1,11 +1,12 @@ -IWorker | poolifier - v3.1.19

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;
    [captureRejectionSymbol]?(error, event, ...args): void;
    addListener(eventName, listener): this;
    emit(eventName, ...args): boolean;
    eventNames(): (string | symbol)[];
    getMaxListeners(): number;
    listenerCount(eventName, listener?): number;
    listeners(eventName): Function[];
    off(eventName, listener): this;
    prependListener(eventName, listener): this;
    prependOnceListener(eventName, listener): this;
    rawListeners(eventName): Function[];
    removeAllListeners(event?): this;
    removeListener(eventName, listener): this;
    setMaxListeners(n): this;
}

Hierarchy

  • EventEmitter
    • IWorker

Properties

disconnect? +IWorker | poolifier - v3.1.20

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]?(error, event, ...args): void;
    addListener(eventName, listener): this;
    emit(eventName, ...args): boolean;
    eventNames(): (string | symbol)[];
    getMaxListeners(): number;
    listenerCount(eventName, listener?): number;
    listeners(eventName): Function[];
    off(eventName, listener): this;
    prependListener(eventName, listener): this;
    prependOnceListener(eventName, listener): this;
    rawListeners(eventName): Function[];
    removeAllListeners(event?): this;
    removeListener(eventName, listener): this;
    setMaxListeners(n): this;
}

Hierarchy

  • EventEmitter
    • IWorker

Properties

disconnect?: (() => void)

Cluster worker disconnect.

Type declaration

    • (): void
    • Cluster worker disconnect.

      -

      Returns void

id?: number

Cluster worker id.

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

Cluster worker kill.

+

Returns void

id?: number

Cluster worker id.

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

Cluster worker kill.

Type declaration

    • (signal?): void
    • Cluster worker kill.

      -

      Parameters

      • Optional signal: string

      Returns void

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

Registers an event handler.

+

Parameters

  • Optional signal: string

Returns void

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

Registers an event handler.

Type declaration

    • (event, handler): this
    • Registers an event handler.

      Parameters

      Returns this

Param: event

The event.

Param: handler

The event handler.

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

Registers once an event handler.

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

Registers once an event handler.

Type declaration

    • (event, handler): this
    • Registers once an event handler.

      Parameters

      Returns this

Param: event

The event.

Param: handler

The event handler.

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

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

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>
    • 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.

      -

      Returns Promise<number>

threadId?: number

Worker thread worker id.

-

Methods

  • Parameters

    • error: Error
    • event: string
    • Rest ...args: any[]

    Returns void

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

    +

    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
    • 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.

      +

      Returns void

      Since

      v10.5.0

      +

Since

v10.5.0

+

Methods

  • Parameters

    • error: Error
    • event: string
    • Rest ...args: any[]

    Returns void

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

    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 namedeventName, in the order they were registered, passing the supplied arguments to each.

    @@ -129,4 +136,4 @@ memory leaks. The emitter.setMaxListeners() method allows the limit modified for this specific EventEmitter instance. The value can be set toInfinity (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

    -

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file