Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • Task

Index

Constructors

constructor

  • new Task(command: string, parser: Parser<T>): Task
  • 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

Properties

command

command: string

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

parser

parser: Parser<T>

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

Accessors

pending

  • get pending(): boolean

promise

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

    the resolution or rejection of this task.

state

  • get state(): string

stderr

  • get stderr(): string

stdout

  • get stdout(): string

Methods

onStderr

  • onStderr(buf: string | Buffer): void
  • Parameters

    • buf: string | Buffer

    Returns void

onStdout

  • onStdout(buf: string | Buffer): void
  • Parameters

    • buf: string | Buffer

    Returns void

reject

  • reject(error: Error, source?: string): void
  • This is for use by BatchProcess only, and will only be called when the process has errored after N retries

    Parameters

    • error: Error
    • Default value source: string = "Task.reject()"

    Returns void

resolve

  • resolve(result: string, stderr: string): void
  • This is for use by BatchProcess only, and will only be called when the process is complete for this task's command

    Parameters

    • result: string
    • stderr: string

    Returns void

toString

  • toString(): string

Generated using TypeDoc