diff --git a/docs/assets/search.js b/docs/assets/search.js index 5d850e7..485a971 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":128,\"name\":\"WorkerManager\",\"url\":\"classes/WorkerManager.html\",\"classes\":\"\"},{\"kind\":2048,\"name\":\"createWorkerManager\",\"url\":\"classes/WorkerManager.html#createWorkerManager\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/WorkerManager.html#constructor\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":1024,\"name\":\"pool\",\"url\":\"classes/WorkerManager.html#pool\",\"classes\":\"tsd-is-protected\",\"parent\":\"WorkerManager\"},{\"kind\":1024,\"name\":\"logger\",\"url\":\"classes/WorkerManager.html#logger\",\"classes\":\"tsd-is-protected\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"destroy\",\"url\":\"classes/WorkerManager.html#destroy\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"call\",\"url\":\"classes/WorkerManager.html#call\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"queue\",\"url\":\"classes/WorkerManager.html#queue\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"completed\",\"url\":\"classes/WorkerManager.html#completed\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"settled\",\"url\":\"classes/WorkerManager.html#settled\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":32,\"name\":\"workerModule\",\"url\":\"variables/workerModule-1.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"variables/workerModule-1.html#__type\",\"classes\":\"\",\"parent\":\"workerModule\"},{\"kind\":2048,\"name\":\"isRunningInWorker\",\"url\":\"variables/workerModule-1.html#__type.isRunningInWorker\",\"classes\":\"\",\"parent\":\"workerModule.__type\"},{\"kind\":2048,\"name\":\"sleep\",\"url\":\"variables/workerModule-1.html#__type.sleep\",\"classes\":\"\",\"parent\":\"workerModule.__type\"},{\"kind\":2048,\"name\":\"transferBuffer\",\"url\":\"variables/workerModule-1.html#__type.transferBuffer\",\"classes\":\"\",\"parent\":\"workerModule.__type\"},{\"kind\":4,\"name\":\"errors\",\"url\":\"modules/errors.html\",\"classes\":\"\"},{\"kind\":128,\"name\":\"ErrorWorkerManager\",\"url\":\"classes/errors.ErrorWorkerManager.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerManager.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerManager\"},{\"kind\":128,\"name\":\"ErrorWorkerManagerDestroyed\",\"url\":\"classes/errors.ErrorWorkerManagerDestroyed.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerManagerDestroyed.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerManagerDestroyed\"},{\"kind\":256,\"name\":\"WorkerManagerInterface\",\"url\":\"interfaces/WorkerManagerInterface.html\",\"classes\":\"\"},{\"kind\":2048,\"name\":\"destroy\",\"url\":\"interfaces/WorkerManagerInterface.html#destroy\",\"classes\":\"\",\"parent\":\"WorkerManagerInterface\"},{\"kind\":2048,\"name\":\"call\",\"url\":\"interfaces/WorkerManagerInterface.html#call\",\"classes\":\"\",\"parent\":\"WorkerManagerInterface\"},{\"kind\":2048,\"name\":\"queue\",\"url\":\"interfaces/WorkerManagerInterface.html#queue\",\"classes\":\"\",\"parent\":\"WorkerManagerInterface\"},{\"kind\":2048,\"name\":\"completed\",\"url\":\"interfaces/WorkerManagerInterface.html#completed\",\"classes\":\"\",\"parent\":\"WorkerManagerInterface\"},{\"kind\":2048,\"name\":\"settled\",\"url\":\"interfaces/WorkerManagerInterface.html#settled\",\"classes\":\"\",\"parent\":\"WorkerManagerInterface\"},{\"kind\":4194304,\"name\":\"WorkerModule\",\"url\":\"types/WorkerModule.html\",\"classes\":\"\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,29.267]],[\"comment/0\",[]],[\"name/1\",[1,29.267]],[\"comment/1\",[]],[\"name/2\",[2,29.267]],[\"comment/2\",[]],[\"name/3\",[3,29.267]],[\"comment/3\",[]],[\"name/4\",[4,29.267]],[\"comment/4\",[]],[\"name/5\",[5,24.159]],[\"comment/5\",[]],[\"name/6\",[6,24.159]],[\"comment/6\",[]],[\"name/7\",[7,24.159]],[\"comment/7\",[]],[\"name/8\",[8,24.159]],[\"comment/8\",[]],[\"name/9\",[9,24.159]],[\"comment/9\",[]],[\"name/10\",[10,24.159]],[\"comment/10\",[]],[\"name/11\",[11,29.267]],[\"comment/11\",[]],[\"name/12\",[12,29.267]],[\"comment/12\",[]],[\"name/13\",[13,29.267]],[\"comment/13\",[]],[\"name/14\",[14,29.267]],[\"comment/14\",[]],[\"name/15\",[15,29.267]],[\"comment/15\",[]],[\"name/16\",[16,29.267]],[\"comment/16\",[]],[\"name/17\",[17,24.159]],[\"comment/17\",[]],[\"name/18\",[18,29.267]],[\"comment/18\",[]],[\"name/19\",[17,24.159]],[\"comment/19\",[]],[\"name/20\",[19,29.267]],[\"comment/20\",[]],[\"name/21\",[5,24.159]],[\"comment/21\",[]],[\"name/22\",[6,24.159]],[\"comment/22\",[]],[\"name/23\",[7,24.159]],[\"comment/23\",[]],[\"name/24\",[8,24.159]],[\"comment/24\",[]],[\"name/25\",[9,24.159]],[\"comment/25\",[]],[\"name/26\",[10,24.159]],[\"comment/26\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":11,\"name\":{\"11\":{}},\"comment\":{}}],[\"call\",{\"_index\":6,\"name\":{\"6\":{},\"22\":{}},\"comment\":{}}],[\"completed\",{\"_index\":8,\"name\":{\"8\":{},\"24\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"createworkermanager\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"description\",{\"_index\":17,\"name\":{\"17\":{},\"19\":{}},\"comment\":{}}],[\"destroy\",{\"_index\":5,\"name\":{\"5\":{},\"21\":{}},\"comment\":{}}],[\"errors\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"errorworkermanager\",{\"_index\":16,\"name\":{\"16\":{}},\"comment\":{}}],[\"errorworkermanagerdestroyed\",{\"_index\":18,\"name\":{\"18\":{}},\"comment\":{}}],[\"isrunninginworker\",{\"_index\":12,\"name\":{\"12\":{}},\"comment\":{}}],[\"logger\",{\"_index\":4,\"name\":{\"4\":{}},\"comment\":{}}],[\"pool\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"queue\",{\"_index\":7,\"name\":{\"7\":{},\"23\":{}},\"comment\":{}}],[\"settled\",{\"_index\":9,\"name\":{\"9\":{},\"25\":{}},\"comment\":{}}],[\"sleep\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"transferbuffer\",{\"_index\":14,\"name\":{\"14\":{}},\"comment\":{}}],[\"workermanager\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"workermanagerinterface\",{\"_index\":19,\"name\":{\"20\":{}},\"comment\":{}}],[\"workermodule\",{\"_index\":10,\"name\":{\"10\":{},\"26\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = JSON.parse("{\"rows\":[{\"kind\":128,\"name\":\"WorkerManager\",\"url\":\"classes/WorkerManager.html\",\"classes\":\"\"},{\"kind\":2048,\"name\":\"createWorkerManager\",\"url\":\"classes/WorkerManager.html#createWorkerManager\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/WorkerManager.html#constructor\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":1024,\"name\":\"pool\",\"url\":\"classes/WorkerManager.html#pool\",\"classes\":\"tsd-is-protected\",\"parent\":\"WorkerManager\"},{\"kind\":1024,\"name\":\"logger\",\"url\":\"classes/WorkerManager.html#logger\",\"classes\":\"tsd-is-protected\",\"parent\":\"WorkerManager\"},{\"kind\":1024,\"name\":\"methods\",\"url\":\"classes/WorkerManager.html#methods\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"destroy\",\"url\":\"classes/WorkerManager.html#destroy\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"call\",\"url\":\"classes/WorkerManager.html#call\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"queue\",\"url\":\"classes/WorkerManager.html#queue\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"completed\",\"url\":\"classes/WorkerManager.html#completed\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":2048,\"name\":\"settled\",\"url\":\"classes/WorkerManager.html#settled\",\"classes\":\"\",\"parent\":\"WorkerManager\"},{\"kind\":64,\"name\":\"expose\",\"url\":\"functions/expose.html\",\"classes\":\"\"},{\"kind\":4,\"name\":\"errors\",\"url\":\"modules/errors.html\",\"classes\":\"\"},{\"kind\":128,\"name\":\"ErrorWorkers\",\"url\":\"classes/errors.ErrorWorkers.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkers.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkers\"},{\"kind\":128,\"name\":\"ErrorWorkersUndefinedBehaviour\",\"url\":\"classes/errors.ErrorWorkersUndefinedBehaviour.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkersUndefinedBehaviour.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkersUndefinedBehaviour\"},{\"kind\":128,\"name\":\"ErrorWorkerManager\",\"url\":\"classes/errors.ErrorWorkerManager.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerManager.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerManager\"},{\"kind\":128,\"name\":\"ErrorWorkerManagerDestroyed\",\"url\":\"classes/errors.ErrorWorkerManagerDestroyed.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerManagerDestroyed.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerManagerDestroyed\"},{\"kind\":128,\"name\":\"ErrorWorkerPool\",\"url\":\"classes/errors.ErrorWorkerPool.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerPool.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerPool\"},{\"kind\":128,\"name\":\"ErrorWorkerPoolInvalidWorkers\",\"url\":\"classes/errors.ErrorWorkerPoolInvalidWorkers.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerPoolInvalidWorkers.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerPoolInvalidWorkers\"},{\"kind\":128,\"name\":\"ErrorWorkerPoolWorkerCreationFailed\",\"url\":\"classes/errors.ErrorWorkerPoolWorkerCreationFailed.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerPoolWorkerCreationFailed.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerPoolWorkerCreationFailed\"},{\"kind\":128,\"name\":\"ErrorWorkerPoolWorkerTerminated\",\"url\":\"classes/errors.ErrorWorkerPoolWorkerTerminated.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerPoolWorkerTerminated.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerPoolWorkerTerminated\"},{\"kind\":128,\"name\":\"ErrorWorker\",\"url\":\"classes/errors.ErrorWorker.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorker.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorker\"},{\"kind\":128,\"name\":\"ErrorWorkerHandlerMissing\",\"url\":\"classes/errors.ErrorWorkerHandlerMissing.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerHandlerMissing.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerHandlerMissing\"},{\"kind\":128,\"name\":\"ErrorWorkerInitializationFailed\",\"url\":\"classes/errors.ErrorWorkerInitializationFailed.html\",\"classes\":\"\",\"parent\":\"errors\"},{\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorWorkerInitializationFailed.html#description\",\"classes\":\"\",\"parent\":\"errors.ErrorWorkerInitializationFailed\"},{\"kind\":4194304,\"name\":\"WorkerFactory\",\"url\":\"types/WorkerFactory.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/WorkerFactory.html#__type\",\"classes\":\"\",\"parent\":\"WorkerFactory\"},{\"kind\":4194304,\"name\":\"WorkerTaskInformation\",\"url\":\"types/WorkerTaskInformation.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/WorkerTaskInformation.html#__type\",\"classes\":\"\",\"parent\":\"WorkerTaskInformation\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"types/WorkerTaskInformation.html#__type.type\",\"classes\":\"\",\"parent\":\"WorkerTaskInformation.__type\"},{\"kind\":1024,\"name\":\"data\",\"url\":\"types/WorkerTaskInformation.html#__type.data\",\"classes\":\"\",\"parent\":\"WorkerTaskInformation.__type\"},{\"kind\":1024,\"name\":\"transferList\",\"url\":\"types/WorkerTaskInformation.html#__type.transferList\",\"classes\":\"\",\"parent\":\"WorkerTaskInformation.__type\"},{\"kind\":4194304,\"name\":\"WorkerFunction\",\"url\":\"types/WorkerFunction.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/WorkerFunction.html#__type\",\"classes\":\"\",\"parent\":\"WorkerFunction\"},{\"kind\":4194304,\"name\":\"WorkerResult\",\"url\":\"types/WorkerResult.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/WorkerResult.html#__type\",\"classes\":\"\",\"parent\":\"WorkerResult\"},{\"kind\":1024,\"name\":\"data\",\"url\":\"types/WorkerResult.html#__type.data\",\"classes\":\"\",\"parent\":\"WorkerResult.__type\"},{\"kind\":1024,\"name\":\"transferList\",\"url\":\"types/WorkerResult.html#__type.transferList\",\"classes\":\"\",\"parent\":\"WorkerResult.__type\"},{\"kind\":4194304,\"name\":\"WorkerResultInternal\",\"url\":\"types/WorkerResultInternal.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"WorkerManifest\",\"url\":\"types/WorkerManifest.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TaskCallback\",\"url\":\"types/TaskCallback.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/TaskCallback.html#__type\",\"classes\":\"\",\"parent\":\"TaskCallback\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,35.648]],[\"comment/0\",[]],[\"name/1\",[1,35.648]],[\"comment/1\",[]],[\"name/2\",[2,35.648]],[\"comment/2\",[]],[\"name/3\",[3,35.648]],[\"comment/3\",[]],[\"name/4\",[4,35.648]],[\"comment/4\",[]],[\"name/5\",[5,35.648]],[\"comment/5\",[]],[\"name/6\",[6,35.648]],[\"comment/6\",[]],[\"name/7\",[7,35.648]],[\"comment/7\",[]],[\"name/8\",[8,35.648]],[\"comment/8\",[]],[\"name/9\",[9,35.648]],[\"comment/9\",[]],[\"name/10\",[10,35.648]],[\"comment/10\",[]],[\"name/11\",[11,35.648]],[\"comment/11\",[]],[\"name/12\",[12,35.648]],[\"comment/12\",[]],[\"name/13\",[13,35.648]],[\"comment/13\",[]],[\"name/14\",[14,15.279]],[\"comment/14\",[]],[\"name/15\",[15,35.648]],[\"comment/15\",[]],[\"name/16\",[14,15.279]],[\"comment/16\",[]],[\"name/17\",[16,35.648]],[\"comment/17\",[]],[\"name/18\",[14,15.279]],[\"comment/18\",[]],[\"name/19\",[17,35.648]],[\"comment/19\",[]],[\"name/20\",[14,15.279]],[\"comment/20\",[]],[\"name/21\",[18,35.648]],[\"comment/21\",[]],[\"name/22\",[14,15.279]],[\"comment/22\",[]],[\"name/23\",[19,35.648]],[\"comment/23\",[]],[\"name/24\",[14,15.279]],[\"comment/24\",[]],[\"name/25\",[20,35.648]],[\"comment/25\",[]],[\"name/26\",[14,15.279]],[\"comment/26\",[]],[\"name/27\",[21,35.648]],[\"comment/27\",[]],[\"name/28\",[14,15.279]],[\"comment/28\",[]],[\"name/29\",[22,35.648]],[\"comment/29\",[]],[\"name/30\",[14,15.279]],[\"comment/30\",[]],[\"name/31\",[23,35.648]],[\"comment/31\",[]],[\"name/32\",[14,15.279]],[\"comment/32\",[]],[\"name/33\",[24,35.648]],[\"comment/33\",[]],[\"name/34\",[14,15.279]],[\"comment/34\",[]],[\"name/35\",[25,35.648]],[\"comment/35\",[]],[\"name/36\",[26,22.655]],[\"comment/36\",[]],[\"name/37\",[27,35.648]],[\"comment/37\",[]],[\"name/38\",[26,22.655]],[\"comment/38\",[]],[\"name/39\",[28,35.648]],[\"comment/39\",[]],[\"name/40\",[29,30.54]],[\"comment/40\",[]],[\"name/41\",[30,30.54]],[\"comment/41\",[]],[\"name/42\",[31,35.648]],[\"comment/42\",[]],[\"name/43\",[26,22.655]],[\"comment/43\",[]],[\"name/44\",[32,35.648]],[\"comment/44\",[]],[\"name/45\",[26,22.655]],[\"comment/45\",[]],[\"name/46\",[29,30.54]],[\"comment/46\",[]],[\"name/47\",[30,30.54]],[\"comment/47\",[]],[\"name/48\",[33,35.648]],[\"comment/48\",[]],[\"name/49\",[34,35.648]],[\"comment/49\",[]],[\"name/50\",[35,35.648]],[\"comment/50\",[]],[\"name/51\",[26,22.655]],[\"comment/51\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":26,\"name\":{\"36\":{},\"38\":{},\"43\":{},\"45\":{},\"51\":{}},\"comment\":{}}],[\"call\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"completed\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"createworkermanager\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"data\",{\"_index\":29,\"name\":{\"40\":{},\"46\":{}},\"comment\":{}}],[\"description\",{\"_index\":14,\"name\":{\"14\":{},\"16\":{},\"18\":{},\"20\":{},\"22\":{},\"24\":{},\"26\":{},\"28\":{},\"30\":{},\"32\":{},\"34\":{}},\"comment\":{}}],[\"destroy\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"errors\",{\"_index\":12,\"name\":{\"12\":{}},\"comment\":{}}],[\"errorworker\",{\"_index\":22,\"name\":{\"29\":{}},\"comment\":{}}],[\"errorworkerhandlermissing\",{\"_index\":23,\"name\":{\"31\":{}},\"comment\":{}}],[\"errorworkerinitializationfailed\",{\"_index\":24,\"name\":{\"33\":{}},\"comment\":{}}],[\"errorworkermanager\",{\"_index\":16,\"name\":{\"17\":{}},\"comment\":{}}],[\"errorworkermanagerdestroyed\",{\"_index\":17,\"name\":{\"19\":{}},\"comment\":{}}],[\"errorworkerpool\",{\"_index\":18,\"name\":{\"21\":{}},\"comment\":{}}],[\"errorworkerpoolinvalidworkers\",{\"_index\":19,\"name\":{\"23\":{}},\"comment\":{}}],[\"errorworkerpoolworkercreationfailed\",{\"_index\":20,\"name\":{\"25\":{}},\"comment\":{}}],[\"errorworkerpoolworkerterminated\",{\"_index\":21,\"name\":{\"27\":{}},\"comment\":{}}],[\"errorworkers\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"errorworkersundefinedbehaviour\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"expose\",{\"_index\":11,\"name\":{\"11\":{}},\"comment\":{}}],[\"logger\",{\"_index\":4,\"name\":{\"4\":{}},\"comment\":{}}],[\"methods\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}],[\"pool\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"queue\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"settled\",{\"_index\":10,\"name\":{\"10\":{}},\"comment\":{}}],[\"taskcallback\",{\"_index\":35,\"name\":{\"50\":{}},\"comment\":{}}],[\"transferlist\",{\"_index\":30,\"name\":{\"41\":{},\"47\":{}},\"comment\":{}}],[\"type\",{\"_index\":28,\"name\":{\"39\":{}},\"comment\":{}}],[\"workerfactory\",{\"_index\":25,\"name\":{\"35\":{}},\"comment\":{}}],[\"workerfunction\",{\"_index\":31,\"name\":{\"42\":{}},\"comment\":{}}],[\"workermanager\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"workermanifest\",{\"_index\":34,\"name\":{\"49\":{}},\"comment\":{}}],[\"workerresult\",{\"_index\":32,\"name\":{\"44\":{}},\"comment\":{}}],[\"workerresultinternal\",{\"_index\":33,\"name\":{\"48\":{}},\"comment\":{}}],[\"workertaskinformation\",{\"_index\":27,\"name\":{\"37\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file diff --git a/docs/classes/WorkerManager.html b/docs/classes/WorkerManager.html index 600bdf0..a9709e3 100644 --- a/docs/classes/WorkerManager.html +++ b/docs/classes/WorkerManager.html @@ -14,22 +14,18 @@ -

Class WorkerManager<W>

+

Class WorkerManager<Manifest>

Type Parameters

+

Manifest extends WorkerManifest

Hierarchy

-
-

Implements

-
@@ -42,6 +38,7 @@

Constructors

Properties

@@ -58,186 +55,207 @@

Constructors

    - +
  • +

    Constructs a new instance of the class using the provided parameters.

    +

    Type Parameters

    • -

      W extends ModuleMethods

    +

    Manifest extends WorkerManifest

Parameters

  • -
    __namedParameters: {
        cores?: number;
        logger: Logger;
        workerFactory: (() => Promise<ModuleThread<W>>);
    }
    +
    config: {
        cores: number;
        logger: Logger;
        manifest: Manifest;
        workerFactory: WorkerFactory;
    }
    +

    The configuration for the constructor.

    +
    +
    • -
      Optional cores?: number
    • +
      cores: number
      +

      The number of cores to allocate for the worker pool.

      +
      +
    • -
      logger: Logger
    • +
      logger: Logger
      +

      The logger instance for logging messages.

      +
      +
    • -
      workerFactory: (() => Promise<ModuleThread<W>>)
      -
        -
      • -
          -
        • (): Promise<ModuleThread<W>>
        • -
        • -

          Returns Promise<ModuleThread<W>>

-

Returns WorkerManager<W>

+
  • Defined in src/WorkerManager.ts:60
  • Properties

    logger: Logger
    +
  • Defined in src/WorkerManager.ts:44
  • +
    + +
    methods: Manifest
    +

    Methods exposes a fully typed interface for making calls using workers. +It provides all the available methods provided by the manifest with proper types applied.

    +
    +
    -
    pool: Pool<ModuleThread<W>>
    +
  • Defined in src/WorkerManager.ts:43
  • Methods

    +

    Returns Promise<WorkerResult>

    A promise that resolves with the result of the worker task execution.

    + +
    +
  • Defined in src/WorkerManager.ts:109
  • +
  • Defined in src/WorkerManager.ts:136
  • +

    Returns Promise<void>

    A promise that resolves when the destruction process is complete.

    + +
    +
  • Defined in src/WorkerManager.ts:95
  • +

    Returns Promise<WorkerResult>

    A promise that resolves with the result of the task or rejects with an error if the task fails or cannot be processed.

    + +
    +
  • Defined in src/WorkerManager.ts:120
  • +
  • Defined in src/WorkerManager.ts:148
  • Parameters

    -

    Returns Promise<WorkerManager<W>>

    +
    manifest: Manifest
    +

    The manifest defining the worker capabilities and operations.

    +
    +
    +
  • +
    workerFactory: WorkerFactory
    +

    The factory for creating workers.

    +
    +
  • +

    Returns Promise<WorkerManager<Manifest>>

    A promise that resolves to a new WorkerManager instance.

    +
    +
  • Defined in src/WorkerManager.ts:21
  • +
  • TaskCallback
  • +
  • WorkerFactory
  • +
  • WorkerFunction
  • +
  • WorkerManifest
  • +
  • WorkerResult
  • +
  • WorkerResultInternal
  • +
  • WorkerTaskInformation
  • +
  • expose
  • Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/errors.ErrorWorkerManager.html b/docs/classes/errors.ErrorWorkerManager.html index 3d6affe..414da24 100644 --- a/docs/classes/errors.ErrorWorkerManager.html +++ b/docs/classes/errors.ErrorWorkerManager.html @@ -24,13 +24,13 @@

    T

    Hierarchy

    +
  • Defined in src/errors.ts:11
  • @@ -89,7 +89,7 @@
    Optional
    Optional timestamp?: Date

    Returns ErrorWorkerManager<T>

    @@ -101,7 +101,7 @@
    @@ -110,25 +110,25 @@
    message: string
    name: string
    stack?: string
    @@ -138,15 +138,15 @@
    description: string = 'WorkerManager error'
    +
  • Defined in src/errors.ts:12
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -170,15 +170,15 @@

    Returns any

    See

    https://v8.dev/docs/stack-trace-api#customizing-stack-traces

    +
  • Defined in node_modules/@types/node/globals.d.ts:98
  • stackTraceLimit: number
    +
  • Defined in node_modules/@types/node/globals.d.ts:100
  • Accessors

    @@ -187,7 +187,7 @@
    @@ -207,7 +207,7 @@
    @@ -226,9 +226,9 @@
    targetObject: Optional constructorOpt: Function

    Returns void

    +
  • Defined in node_modules/@types/node/globals.d.ts:91
  • Returns InstanceType<T>

    @@ -297,12 +297,26 @@

    errors +
  • ErrorWorker
  • +
  • ErrorWorkerHandlerMissing
  • +
  • ErrorWorkerInitializationFailed
  • +
  • ErrorWorkerManager
  • +
  • ErrorWorkerManagerDestroyed
  • +
  • ErrorWorkerPool
  • +
  • ErrorWorkerPoolInvalidWorkers
  • +
  • ErrorWorkerPoolWorkerCreationFailed
  • +
  • ErrorWorkerPoolWorkerTerminated
  • +
  • ErrorWorkers
  • +
  • ErrorWorkersUndefinedBehaviour
  • WorkerManager
  • -
  • WorkerManagerInterface
  • -
  • WorkerModule
  • -
  • workerModule
  • +
  • TaskCallback
  • +
  • WorkerFactory
  • +
  • WorkerFunction
  • +
  • WorkerManifest
  • +
  • WorkerResult
  • +
  • WorkerResultInternal
  • +
  • WorkerTaskInformation
  • +
  • expose
  • Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/errors.ErrorWorkerManagerDestroyed.html b/docs/classes/errors.ErrorWorkerManagerDestroyed.html index c1e00d4..6301603 100644 --- a/docs/classes/errors.ErrorWorkerManagerDestroyed.html +++ b/docs/classes/errors.ErrorWorkerManagerDestroyed.html @@ -28,7 +28,7 @@

    Hierarchy

    +
  • Defined in src/errors.ts:15
  • @@ -144,7 +144,7 @@
    +
  • Defined in src/errors.ts:16
  • prepareStackTrace?: ((err, stackTraces) => any)
    @@ -170,13 +170,13 @@

    See

    Inherited from ErrorWorkerManager.prepareStackTrace

    +
  • Defined in node_modules/@types/node/globals.d.ts:98
  • stackTraceLimit: number
    +
  • Defined in node_modules/@types/node/globals.d.ts:100
  • Accessors

    @@ -226,7 +226,7 @@

    Returns void

    +
  • Defined in node_modules/@types/node/globals.d.ts:91
  • WorkerManager
  • -
  • WorkerManagerInterface
  • -
  • WorkerModule
  • -
  • workerModule
  • +
  • TaskCallback
  • +
  • WorkerFactory
  • +
  • WorkerFunction
  • +
  • WorkerManifest
  • +
  • WorkerResult
  • +
  • WorkerResultInternal
  • +
  • WorkerTaskInformation
  • +
  • expose
  • Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index fabbb66..198b625 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,9 +12,7 @@

    @matrixai/workers

    -

    js-workers

    staging:pipeline status -master:pipeline status

    -

    Workers is the library for multi-threading in MatrixAI's JavaScript/TypeScript applications. It is based on top of threads.js.

    +

    js-workers

    Workers is the library for multi-threading in MatrixAI's JavaScript/TypeScript applications. It is based on top of threads.js.

    Currently no support for Mobile OSes.

    Note that only ArrayBuffer can be zero-copy transferred to the worker threads. This means if you are wroking with Node Buffer you must first slice and copy the ArrayBuffer out of the Node Buffer.

    const b = Buffer.from('hello world');
    const ab = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); @@ -25,8 +23,8 @@

    @matrixai/workers

    See the benchmarks and tests for examples of using this library.

    Installation

    npm install --save @matrixai/workers
     
    -

    Development

    Run nix-shell, and once you're inside, you can use:

    -
    # install (or reinstall packages from package.json)
    npm install
    # build the dist
    npm run build
    # run the repl (this allows you to import from ./src)
    npm run ts-node
    # run the tests
    npm run test
    # lint the source code
    npm run lint
    # automatically fix the source
    npm run lintfix +

    Development

    Run nix develop, and once you're inside, you can use:

    +
    # install (or reinstall packages from package.json)
    npm install
    # build the dist
    npm run build
    # run the repl (this allows you to import from ./src)
    npm run tsx
    # run the tests
    npm run test
    # lint the source code
    npm run lint
    # automatically fix the source
    npm run lintfix

    Benchmarks

    npm run bench
     
    @@ -81,9 +79,14 @@

  • errors
  • WorkerManager
  • -
  • WorkerManagerInterface
  • -
  • WorkerModule
  • -
  • workerModule
  • +
  • TaskCallback
  • +
  • WorkerFactory
  • +
  • WorkerFunction
  • +
  • WorkerManifest
  • +
  • WorkerResult
  • +
  • WorkerResultInternal
  • +
  • WorkerTaskInformation
  • +
  • expose
  • Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/WorkerManagerInterface.html b/docs/interfaces/WorkerManagerInterface.html deleted file mode 100644 index e7a3382..0000000 --- a/docs/interfaces/WorkerManagerInterface.html +++ /dev/null @@ -1,172 +0,0 @@ -WorkerManagerInterface | @matrixai/workers
    -
    - -
    -
    -
    -
    - -

    Interface WorkerManagerInterface<W>

    -
    -

    Type Parameters

    -
      -
    • -

      W extends ModuleMethods

    -
    -

    Hierarchy

    -
      -
    • WorkerManagerInterface
    -
    -

    Implemented by

    -
    -
    -
    -
    - -
    -
    -

    Methods

    -
    -
    -

    Methods

    -
    - -
      - -
    • -
      -

      Type Parameters

      -
        -
      • -

        T

      -
      -

      Parameters

      -
        -
      • -
        f: ((worker) => Promise<T>)
        -
          -
        • -
            -
          • (worker): Promise<T>
          • -
          • -
            -

            Parameters

            -
              -
            • -
              worker: ModuleThread<W>
            -

            Returns Promise<T>

      -

      Returns Promise<T>

    -
    - -
    -
    - -
      - -
    • -
      -

      Parameters

      -
        -
      • -
        Optional options: {
            force?: boolean;
        }
        -
          -
        • -
          Optional force?: boolean
      -

      Returns Promise<void>

    -
    - -
      - -
    • -
      -

      Type Parameters

      -
        -
      • -

        T

      -
      -

      Parameters

      -
        -
      • -
        f: ((worker) => Promise<T>)
        -
          -
        • -
            -
          • (worker): Promise<T>
          • -
          • -
            -

            Parameters

            -
              -
            • -
              worker: ModuleThread<W>
            -

            Returns Promise<T>

      -

      Returns QueuedTask<ModuleThread<W>, T>

    -
    - -
    -
    - -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 56802ae..72715e5 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -24,16 +24,18 @@

    Classes

    -

    Interfaces

    -
    -

    Type Aliases

    -
    -

    Variables

    -
    workerModule +

    Functions

    +
  • WorkerManager
  • -
  • WorkerManagerInterface
  • -
  • WorkerModule
  • -
  • workerModule
  • +
  • TaskCallback
  • +
  • WorkerFactory
  • +
  • WorkerFunction
  • +
  • WorkerManifest
  • +
  • WorkerResult
  • +
  • WorkerResultInternal
  • +
  • WorkerTaskInformation
  • +
  • expose
  • Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/types/WorkerModule.html b/docs/types/WorkerModule.html deleted file mode 100644 index 0e936d2..0000000 --- a/docs/types/WorkerModule.html +++ /dev/null @@ -1,46 +0,0 @@ -WorkerModule | @matrixai/workers
    -
    - -
    -
    -
    -
    - -

    Type alias WorkerModule

    -
    WorkerModule: typeof workerModule
    -
    - -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file diff --git a/docs/variables/workerModule-1.html b/docs/variables/workerModule-1.html deleted file mode 100644 index 38567f4..0000000 --- a/docs/variables/workerModule-1.html +++ /dev/null @@ -1,102 +0,0 @@ -workerModule | @matrixai/workers
    -
    - -
    -
    -
    -
    - -

    Variable workerModuleConst

    -
    workerModule: {
        isRunningInWorker() => boolean;
        sleep(ms) => void;
        transferBuffer(data) => TransferDescriptor<ArrayBuffer>;
    } = ...
    -

    Worker object that contains all functions that will be executed in parallel -Functions should be using CPU-parallelism not IO-parallelism -Most functions should be synchronous, not asynchronous -Making them asynchronous does not make a difference to the caller -The caller must always await because the functions will run on the pool

    -
    -
    -

    Type declaration

    -
      -
    • -
      isRunningInWorker:function
      -
        - -
      • -

        Check if we are running in the worker. -Only used for testing

        -
        -

        Returns boolean

        -
    • -
    • -
      sleep:function
      -
        - -
      • -

        Sleep synchronously -This blocks the entire event loop -Only used for testing

        -
        -
        -

        Parameters

        -
          -
        • -
          ms: number
        -

        Returns void

        -
    • -
    • -
      transferBuffer:function
      -
        - -
      • -

        Zero copy demonstration manipulating buffers

        -
        -
        -

        Parameters

        -
          -
        • -
          data: ArrayBuffer
        -

        Returns TransferDescriptor<ArrayBuffer>

        -
    -
    -
    - -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index dde7945..f7d2c58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/workers", - "version": "1.4.1", + "version": "2.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@matrixai/workers", - "version": "1.4.1", + "version": "2.0.0", "license": "Apache-2.0", "dependencies": { "@matrixai/async-init": "^2.1.2", diff --git a/package.json b/package.json index 8db1a97..b862ab1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/workers", - "version": "1.4.1", + "version": "2.0.0", "author": "Roger Qiu", "description": "Multithreaded Workers", "license": "Apache-2.0",