MCPcopy
hub / github.com/grpc/grpc-go / NewStream

Method NewStream

balancer_wrapper.go:361–368  ·  view source on GitHub ↗

NewStream begins a streaming RPC on the addrConn. If the addrConn is not ready, blocks until it is or ctx expires. Returns an error when the context expires or the addrConn is shut down.

(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption)

Source from the content-addressed store, hash-verified

359// ready, blocks until it is or ctx expires. Returns an error when the context
360// expires or the addrConn is shut down.
361func (acbw *acBalancerWrapper) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) {
362 transport := acbw.ac.getReadyTransport()
363 if transport == nil {
364 return nil, status.Errorf(codes.Unavailable, "SubConn state is not Ready")
365
366 }
367 return newNonRetryClientStream(ctx, desc, method, transport, acbw.ac, opts...)
368}
369
370// Invoke performs a unary RPC. If the addrConn is not ready, returns
371// errSubConnNotReady.

Callers 1

InvokeMethod · 0.95

Calls 3

ErrorfFunction · 0.92
newNonRetryClientStreamFunction · 0.85
getReadyTransportMethod · 0.80

Tested by

no test coverage detected