- Basic Callback Functions #21
- Workers can now implement EventEmitter behaviour
- Worker paths can now be relative
- ts-node is now
transpile-onlyper default #21 - Allows chaining (resolves to the proxy when the worker returns itself)
- Upgrade all dev dependencies
- Improved typing
- Max Queue Size #29
- Subsequent calls will be rejected when max queue size is reached, until the queue is emptied below max again.
- Refill
- automatically refill pool when workers exit via
autoRefill: truepool option - manually refill pool whenever via
worker.pool.refill()
- automatically refill pool when workers exit via
- Drain (graceful shutdown)
- Wait until all calls are done and workers are idle, then terminate, via
worker.pool.drain()
- Wait until all calls are done and workers are idle, then terminate, via
- Stricter and fixed types #16
- Make ts-node optional #7 (@spmiller)
- Bump some dev dependency versions
- TypeScript support 🎉
Building a TypeScript worker on-the-fly with ts-node,
generic
createThreadPool<OwnType>pool creation with generated type from a custom worker type (promise wrapped methods).
- Bump dev dependency versions for security update
- Puddle internal thread id is exposed to worker via
const { threadId } = require('thread-puddle'). - The module now exports
createThreadPoolas a pool constructor. - Loads ECMAScript Modules (ES6 Modules) as workers for node version >= 13.
- Has now only one way to access the pool interface:
workerProxy.pool - Emits worker events on the
workerProxy.poolinterface - Emits an
exitevent when a worker exits,codeandthreadId