Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "from/worker"

Index

Interfaces

Functions

Functions

Const fromWorker

  • Returns a Stream which adds message and error event listeners to given worker and then emits received values.

    remarks

    If terminate is true (default), the worker will be terminated when the stream is being closed (either directly or indirectly, i.e. if the user called ISubscriber.done on the stream or the last child subscription has unsubscribed, depending on config options).

    As with postWorker, the worker can be an existing Worker instance, a JS source code Blob or an URL string. In the latter two cases, a worker is created automatically.

    example

    Type parameters

    • T

    Parameters

    • worker: Worker | Blob | string

      -

    • Optional opts: Partial<FromWorkerOpts>

      -

    Returns Stream<T>

Generated using TypeDoc