Skip to content

Commit

Permalink
Do not flush on each poll_ready call
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed May 25, 2023
1 parent a6c2d13 commit 0f485f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ where
{
type Error = WsError;

fn poll_ready(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
(*self).with_context(Some((ContextWaker::Write, cx)), |s| cvt(s.write_pending()))
fn poll_ready(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}

fn start_send(mut self: Pin<&mut Self>, item: Message) -> Result<(), Self::Error> {
Expand Down

0 comments on commit 0f485f4

Please sign in to comment.