andywer / andywer/threads.js

Export WorkerPool related types to make pool typing easier

未关闭
#372 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
TypeScript
星标
3.5k
派生
173
PR 合并指标
30 天内没有已合并 PR

描述

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!

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。