Class Task<T>

Tasks embody individual jobs given to the underlying child processes. Each instance has a promise that will be resolved or rejected based on the result of the task.

Type Parameters

  • T = any

Constructors

  • Type Parameters

    • T = any

    Parameters

    • command: string

      is the value written to stdin to perform the given task.

    • parser: Parser<T>

      is used to parse resulting data from the underlying process to a typed object.

    Returns Task<T>

Properties

command: string

is the value written to stdin to perform the given task.

parser: Parser<T>

is used to parse resulting data from the underlying process to a typed object.

taskId: number = ...

Accessors

  • get pending(): boolean
  • Returns boolean

  • get promise(): Promise<T>
  • Returns Promise<T>

    the resolution or rejection of this task.

  • get runtimeMs(): undefined | number
  • Returns undefined | number

  • get state(): string
  • Returns string

Methods

  • Parameters

    • opts: TaskOptions

    Returns void

  • Parameters

    • buf: string | Buffer

    Returns void

  • Parameters

    • buf: string | Buffer

    Returns void

  • Parameters

    • error: Error

    Returns boolean

    true if the wrapped promise was rejected

  • Returns string