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

Provide a batched version of EventSubscription #324

Open
ross-weir opened this issue Mar 1, 2024 · 1 comment
Open

Provide a batched version of EventSubscription #324

ross-weir opened this issue Mar 1, 2024 · 1 comment

Comments

@ross-weir
Copy link
Contributor

EventSubscription passes messages to the handler individually, this makes it difficult to perform certain operations such as handling events in a certain order or persisting event data with a database transaction, etc. Basically it just makes it hard for client code to handle events in specific ways

My example use case for batching:

https://github.com/ross-weir/Donera/blob/f28e6d5f6c3686cae4d671f73cea09e3a7a8d337/packages/indexer/src/simple-event-indexer.ts#L46-L69

Could be implemented the same as EventSubscription just pass the event batch to the function instead of individual messages

@polarker
Copy link
Member

polarker commented Mar 1, 2024

That's a great suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants