You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
StapledStream.send_eof should error out if you call it while send_all is pending #1180
Noticed while working on #823: normally, if you try to call send_eof on an object at the same time that another task is already calling send_all or wait_send_all_might_not_block, then send_eof should raise BusyResourceError. But StapledStream.send_eof calls self.send_stream.aclose, which has a different semantics: it interrupts any pending calls. So right now StapledStream.send_eof has the wrong semantics.
To solve this, StapledStream should detect when another task is already calling a send method, and in that case make send_eof raise an exception instead of calling self.send_stream.aclose.
I have a fix for this in my #823 branch, that I'll post shortly.
Activity
Make send_eof a standard part of the Stream interface