Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add async helper for ordered async processing of messages #1990

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

feywind
Copy link
Collaborator

@feywind feywind commented Oct 23, 2024

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.

@feywind feywind requested review from a team as code owners October 23, 2024 20:12
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: pubsub Issues related to the googleapis/nodejs-pubsub API. labels Oct 23, 2024
@feywind feywind added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 23, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant