NewStream creates a new Stream for the client side. This is typically called by generated code. ctx is used for the lifetime of the stream. To ensure resources are not leaked due to the stream returned, one of the following actions must be performed: 1. Call Close on the ClientConn. 2. Cancel the
(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption)
| 165 | // If none of the above happen, a goroutine and a context will be leaked, and grpc |
| 166 | // will not call the optionally-configured stats handler with a stats.End message. |
| 167 | func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { |
| 168 | // allow interceptor to see all applicable call options, which means those |
| 169 | // configured as defaults from dial option as well as per-call options |
| 170 | opts = combine(cc.dopts.callOptions, opts) |
| 171 | |
| 172 | if cc.dopts.streamInt != nil { |
| 173 | return cc.dopts.streamInt(ctx, desc, cc, method, newClientStream, opts...) |
| 174 | } |
| 175 | return newClientStream(ctx, desc, cc, method, opts...) |
| 176 | } |
| 177 | |
| 178 | // NewClientStream is a wrapper for ClientConn.NewStream. |
| 179 | func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) { |
nothing calls this directly
no test coverage detected