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

refactor: make submission impl non blocking #24

Merged

Conversation

mattsse
Copy link
Contributor

@mattsse mattsse commented Jan 4, 2024

This is prep for additional performance improvements.

This moves some things around:

put API in API module
move ValidationApi to its impl

But most importantly this makes the validation part non blocking by spawning it via tokio::spawn_blocking.
previously this entire code section was in async code which should never block (CPU+blocking IO), because this negatively impacts the executor's performance.

Instead these jobs are now executed on the tokio threadpool that is allowed to block.

Copy link
Collaborator

@ckoopmann ckoopmann left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for the contribution 🙏
Just a few questions for my own understanding of the motiviation and implications of the changes.

@ckoopmann ckoopmann merged commit f459784 into ultrasoundmoney:main Jan 9, 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