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

Fix blocking encoding #9

Merged
merged 2 commits into from
Jul 25, 2022
Merged

Fix blocking encoding #9

merged 2 commits into from
Jul 25, 2022

Conversation

bahlo
Copy link
Member

@bahlo bahlo commented Jul 22, 2022

The Gzip-encoding is a sync operation which blocks the async executor. This PR adds spawn_blocking to move it to a separate thread.
It also runs tests on the async-std runtime.

@bahlo bahlo force-pushed the arne/fix-blocking-encoding branch 2 times, most recently from ed06b03 to bf13ad1 Compare July 22, 2022 11:25
@bahlo bahlo requested a review from dasfmi July 22, 2022 11:26
Since the encoding step is not async, it's blocking the async runtime.
This moves the encoding to a blocking thread using `spawn_blocking`.
@bahlo bahlo force-pushed the arne/fix-blocking-encoding branch from bf13ad1 to de8999d Compare July 22, 2022 11:32
@bahlo bahlo merged commit 8ec41e4 into main Jul 25, 2022
@bahlo bahlo deleted the arne/fix-blocking-encoding branch July 25, 2022 07:52
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