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

Flush AsyncBytesProvider on close by default #338

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

JordonPhillips
Copy link
Contributor

@JordonPhillips JordonPhillips commented Nov 25, 2024

This updates the default behavior of close on AsyncBytesProvider to flush already-written data. This should be the less surprising outcome, particularly when the class is used as a context manager.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This updates the default behavior of close on AsyncBytesProvider to
flush already-written data. This should be the less surprising
outcome, particularly when the class is used as a context manager.
@JordonPhillips JordonPhillips changed the title Flush AsyncBytesProvider on exit Flush AsyncBytesProvider on close by default Nov 25, 2024
Comment on lines +465 to +467
# The draining task should be able to complete without errors. When next it
# tries to get a chunk, the provider's iterator will exit.
await drain_task
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anything we can assert about the final state here or is this only to validate nothing is raised?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only to validate that it closes successfully and nothing is raised. The function doesn't return anything directly, so there's nothing else to check.

@JordonPhillips JordonPhillips merged commit fc3257e into develop Nov 25, 2024
5 checks passed
@JordonPhillips JordonPhillips deleted the provide-until-empty branch November 25, 2024 18:13
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