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

add async generators functions to subscribe to updates #8

Merged
merged 7 commits into from
Mar 22, 2023

Conversation

futurekarol
Copy link
Contributor

having to rely on callbacks can be a pita and is not considered good practice.

  • added programUpdates, accountUpdates and bundleResults functions that follow the async generator pattern

if (e instanceof Error) {
onError(e);
} else {
onError(new Error('Deserialization error'));
Copy link
Contributor

Choose a reason for hiding this comment

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

can you log e here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. also removed this try/catch on bundleResults as it would never be reached

@segfaultdoc segfaultdoc merged commit 5cc03f0 into jito-labs:master Mar 22, 2023
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