node-ts / bus

A typescript based enterprise service bus framework based on enterprise integration patterns
https://bus.node-ts.com/
MIT License
270 stars 26 forks source link

Dispatch outbox using worker queue #225

Closed adenhertog closed 4 months ago

adenhertog commented 4 months ago

Adds messages to an in-memory array as the outbox queue, and dispatches using a worker pool

Previously for handlers that sent high volumes of messages (eg, 10K+), the messages would be outboxed as anon async functions. These were previously dispatched using a single Promise.all(), which causes heap exhaustion particularly in low-mem environments.

This update provides the same final behaviour, but does it in a more memory-efficient way.