Skip to content

Export WorkerPool related types to make pool typing easier #372

@sebqq

Description

@sebqq

Hello. First of all, thank you for this great library.

Would it be possible to export ExposedToThreadType, QueuedTask and WorkerPool types to use in our apps? With these types available it would be much easier to type Pool and/or array of tasks inside our apps like:

import { Pool, spawn, ExposedToThreadType, QueuedTask, WorkerPoolType } from 'threads';

...

class App {
    queue: QueuedTask<ExposedToThreadType<OurWorkerModule>, boolean>[];
    pool: WorkerPool<ExposedToThreadType<OurWorkerModule>>;
...

or is there any other way to type these variables? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions