Interface BatchClusterEvents

This interface describes the BatchCluster's event names as fields. The type of the field describes the event data payload.

See BatchClusterEmitter for more details.

interface BatchClusterEvents {
    beforeEnd: (() => void);
    childEnd: ((childProcess, reason) => void);
    childStart: ((childProcess) => void);
    end: (() => void);
    endError: ((error, proc?) => void);
    fatalError: ((error) => void);
    healthCheckError: ((error, proc) => void);
    internalError: ((error) => void);
    noTaskData: ((stdoutData, stderrData, proc) => void);
    startError: ((error, childProcess?) => void);
    taskData: ((data, task, proc) => void);
    taskError: ((error, task, proc) => void);
    taskResolved: ((task, proc) => void);
    taskTimeout: ((timeoutMs, task, proc) => void);
}

Properties

beforeEnd: (() => void)

Emitted when this instance is in the process of ending.

Type declaration

    • (): void
    • Returns void

childEnd: ((childProcess, reason) => void)

Emitted when a child process has ended

Type declaration

childStart: ((childProcess) => void)

Emitted when a child process has started

Type declaration

    • (childProcess): void
    • Parameters

      Returns void

end: (() => void)

Emitted when this instance has ended. No child processes should remain at this point.

Type declaration

    • (): void
    • Returns void

endError: ((error, proc?) => void)

Emitted when a child process has an error during shutdown

Type declaration

    • (error, proc?): void
    • Parameters

      Returns void

fatalError: ((error) => void)

Emitted when .end() is called because the error rate has exceeded BatchClusterOptions.maxReasonableProcessFailuresPerMinute

Type declaration

    • (error): void
    • Parameters

      • error: Error

      Returns void

healthCheckError: ((error, proc) => void)

Emitted when a process fails health checks

Type declaration

    • (error, proc): void
    • Parameters

      Returns void

internalError: ((error) => void)

Emitted when an internal consistency check fails

Type declaration

    • (error): void
    • Parameters

      • error: Error

      Returns void

noTaskData: ((stdoutData, stderrData, proc) => void)

Emitted when child processes write to stdout or stderr without a current task

Type declaration

    • (stdoutData, stderrData, proc): void
    • Parameters

      • stdoutData: null | string | Buffer
      • stderrData: null | string | Buffer
      • proc: BatchProcess

      Returns void

startError: ((error, childProcess?) => void)

Emitted when a child process fails to spin up and run the BatchProcessOptions.versionCommand successfully within BatchClusterOptions.spawnTimeoutMillis.

Type declaration

taskData: ((data, task, proc) => void)

Emitted when tasks receive data, which may be partial chunks from the task stream.

Type declaration

    • (data, task, proc): void
    • Parameters

      Returns void

taskError: ((error, task, proc) => void)

Emitted when a task has an error

Type declaration

    • (error, task, proc): void
    • Parameters

      Returns void

taskResolved: ((task, proc) => void)

Emitted when a task has been resolved

Type declaration

taskTimeout: ((timeoutMs, task, proc) => void)

Emitted when a task times out. Note that a taskError event always succeeds these events.

Type declaration

    • (timeoutMs, task, proc): void
    • Parameters

      Returns void