The whole Workerpool idea may be split up into two main parts:
- A
TaskEmitter which emit tasks as a ReadableSteam
- A
TaskExecutor acting as a WriteableStream which takes task objects as chunks.
Worker concurrency is essentially implemented as back pressure between the streams, we can even allow runner types to be added/removed on the fly.
Questions to be answered:
- Does Deno streams support object mode?
- What if
TaskExecutor has other unknown data piped into it?
The whole Workerpool idea may be split up into two main parts:
TaskEmitterwhich emit tasks as a ReadableSteamTaskExecutoracting as a WriteableStream which takes task objects as chunks.Worker concurrency is essentially implemented as back pressure between the streams, we can even allow runner types to be added/removed on the fly.
Questions to be answered:
TaskExecutorhas other unknown data piped into it?