Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make streaming client closers non-blocking
This updates the behavior of the client streaming methods `BidiStreamForClient.CloseResponse` and `ServerStreamForClient.Close` to be non-blocking, aligning it with the standard behavior of `net/http`'s `Request.Body` closure. Previously, the implementation used a graceful, blocking closure that fully read from the stream before closing. This allows for reuse of the underlying TCP connection. However, this behavior could lead to unexpected client hangs, as users may not anticipate blocking on close. To address this, the closers no long drain the stream. Documentation has been updated to clarify the behavior and provide users a workaround to keep the optimization by Receiving messages until the stream is drain. This avoids unexpected blocking behavior in client applications. Signed-off-by: Edward McFarlane <[email protected]>
- Loading branch information