Skip to content

[enhancement] Managed pool workers #32

@Pandapip1

Description

@Pandapip1

Summary

I have a use case that requires many workers continually running - which this package solves quite nicely.

However, my use case additionally requires the dynamic initialization of new workers (including with per-worker constructor arguments), and the ability to terminate the worker thread both from the worker thread and the main thread.

Proposed API

const worker: Worker = await puddle.createWorker(); // Uses default args
const workerWithCustomArgs: Worker = await puddle.createWorker([1, 2, 3]); // Uses custom args;
// Individually invoke a function of a specific worker
let xyz = await worker.calculateXYZ();
// Terminate worker
await puddle.terminate(workerWithCustomArgs);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions