andywer / andywer/threads.js

Export WorkerPool related types to make pool typing easier

Open
#372 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
3.5k
Forks
173
PR merge metrics
No merged PRs in 30d

Description

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:

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

...

class App {
queue: QueuedTask, boolean>[];
pool: WorkerPool>;
...
```

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.