Skip to content

Is there a way to hook/enumerate that a Body has ended? #2785

Discussion options

You must be logged in to vote

When receiving a body, if you're polling the data of it, you can just trigger a computation once it returns None. Sending would require you to instrument an impl HttpBody. The tower_http::trace body wrapper might help show you. It wraps any other body type with potential callbacks as chunks are emitted and as the body ends.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@AshleySchaeffer
Comment options

@AshleySchaeffer
Comment options

@seanmonstar
Comment options

@AshleySchaeffer
Comment options

Answer selected by AshleySchaeffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2784 on March 19, 2022 18:16.