nodejs-pubsub
nodejs-pubsub copied to clipboard
feat: add async helper for ordered async processing of messages
Adds an AsyncHelper class to the Node Pub/Sub library that helps to process messages in order even with an async handler. For ordering queues especially, it was problematic to try to handle the case of ordered messages coming in and being processed by async code; async uses Promises, and these are basically always guaranteed not to be processed inline. This helper queues messages from the stream.on handler and lets each process before starting the next.