andywer / andywer/threads.js

Export WorkerPool related types to make pool typing easier

Offen
#372 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
TypeScript
Sterne
3.5k
Forks
173
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.