Open carllerche opened 7 years ago
Is there a reason you have the Box around only the first and_then()
and not the second? Or is that a typo?
Box is around the entire statement.. I think I am missing a closing (Edit: you are correct, I updated the snippet) Also, the box is mostly for simplifying the example and not a strict requirement.)
though.
Yeah, I have my code littered with Boxes at the moment, I think I'm just going to wait for impl
returns to start removing them.
Tracking questions that should probably be answered in the documentation.
what's the general approach for resource cleanup?
One cannot perform asynchronous operations in a drop function. One strategy would be to create a "cleanup" task. On drop of a resource (like a transport), send the socket + state to the cleanup task and perform the cleanup there.
How to do a hanshake
Roughly: