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

indexer: make sink hookable to ensure ordering #90

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

fracek
Copy link
Contributor

@fracek fracek commented Jul 1, 2024

Previously, the Sink interface used eventemitter to signal when data was written or flushed.
EventEmitter emits events in order, but doesn't ensure that the listeners are completely done
before calling the listeners for the next events.

This caused issues because we expect listeners for a batch of data to be completely done
before we call the listeners for the next batch of data.

Switch Sink to extend the Hookable class so that calls to callHook await for all
callbacks to be finished before returning.

@fracek fracek requested a review from jaipaljadeja July 1, 2024 17:42
Copy link
Member

@jaipaljadeja jaipaljadeja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@jaipaljadeja jaipaljadeja merged commit 56b6490 into apibara:develop Jul 1, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants