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.
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.