Revert "Fix two-way stream cancelation and pings (#19763)"

This reverts commit 4d698841f4.
This commit is contained in:
Harshavardhana
2024-05-22 03:00:00 -07:00
parent 4d698841f4
commit ae14681c3e
7 changed files with 88 additions and 396 deletions

View File

@@ -89,26 +89,12 @@ func (s *Stream) Results(next func(b []byte) error) (err error) {
return nil
}
if resp.Err != nil {
s.cancel(resp.Err)
return resp.Err
}
err = next(resp.Msg)
if err != nil {
s.cancel(err)
return err
}
}
}
}
// Done will return a channel that will be closed when the stream is done.
// This mirrors context.Done().
func (s *Stream) Done() <-chan struct{} {
return s.ctx.Done()
}
// Err will return the error that caused the stream to end.
// This mirrors context.Err().
func (s *Stream) Err() error {
return s.ctx.Err()
}