Is there a way to hook/enumerate that a Body has ended? #2785
Answered
by
seanmonstar
AshleySchaeffer
asked this question in
Q&A
|
I'd like to do further computations upon the completion of sending/receiving a hyper Body. I'm not 100% sure what the best approach to this is after playing with available methods and some debugging. Anyone got any ideas? |
Answered by
seanmonstar
Mar 19, 2022
Replies: 1 comment 4 replies
|
When receiving a body, if you're polling the data of it, you can just trigger a computation once it returns |
4 replies
Answer selected by
AshleySchaeffer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 animpl HttpBody. Thetower_http::tracebody wrapper might help show you. It wraps any other body type with potential callbacks as chunks are emitted and as the body ends.