batch-cluster
    Preparing search index...

    Class BatchProcess

    BatchProcess manages the care and feeding of a single child process.

    Index

    Constructors

    Properties

    failedTaskCount: number = 0
    name: string
    pid: number
    proc: ChildProcess
    start: number = ...
    startupTaskId: number

    Accessors

    • get currentTask(): undefined | Task<unknown>

      Getter for current task (required by StreamContext interface)

      Returns undefined | Task<unknown>

    • get ended(): boolean

      Returns boolean

      true if this.end() has completed running, which includes child process cleanup. Note that this may return true and the process table may still include the child pid. Call () for an authoritative (but expensive!) answer.

    • get ending(): boolean

      Returns boolean

      true if this.end() has been requested (which may be due to the child process exiting)

    • get exited(): boolean

      Returns boolean

      true if the child process has exited and is no longer in the process table. Note that this may be erroneously false if the process table hasn't been checked. Call () for an authoritative (but expensive!) answer.

    • get healthy(): boolean

      Returns boolean

      true if the process doesn't need to be recycled.

    • get ready(): boolean

      Returns boolean

      true iff this process is both healthy and idle, and ready for a new task.

    Methods

    • End this child process.

      Parameters

      • gracefully: boolean = true

        Wait for any current task to be resolved or rejected before shutting down the child process.

      • reason: WhyNotHealthy

        who called end() (used for logging)

      Returns Promise<void>

      Promise that will be resolved when the process has completed. Subsequent calls to end() will ignore the parameters and return the first endPromise.

    • Returns boolean

      true if the child process is in the process table