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

give the body direct access to its sink writer #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dpatti
Copy link
Collaborator

@dpatti dpatti commented Jan 12, 2022

We normally indirectly gain access to the writer in two ways: one is
through the when_ready_to_write callback, and the other through
transfer_to_writer as an argument. Instead, just give the writer to
the body writer directly but continue to drive it from the outside.

This is mostly a simple refactor, but it gives us the ability to do
something smarter in another branch, which is to query the writer to see
if a flush will succeed or not and report back to the user so they can
act appropriately.

We normally indirectly gain access to the writer in two ways: one is
through the `when_ready_to_write` callback, and the other through
`transfer_to_writer` as an argument. Instead, just give the writer to
the body writer directly but continue to drive it from the outside.

This is mostly a simple refactor, but it gives us the ability to do
something smarter in another branch, which is to query the writer to see
if a flush will succeed or not and report back to the user so they can
act appropriately.
@dpatti dpatti requested a review from seliopou January 12, 2022 23:20
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.

1 participant