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

Function ServerTransportStreamFromContext

server.go:1933–1936  ·  view source on GitHub ↗

ServerTransportStreamFromContext returns the ServerTransportStream saved in ctx. Returns nil if the given context has no stream associated with it (which implies it is not an RPC invocation context). # Experimental Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1931// Notice: This API is EXPERIMENTAL and may be changed or removed in a
1932// later release.
1933func ServerTransportStreamFromContext(ctx context.Context) ServerTransportStream {
1934 s, _ := ctx.Value(streamKey{}).(ServerTransportStream)
1935 return s
1936}
1937
1938// Stop stops the gRPC server. It immediately closes all open
1939// connections and listeners.

Callers 8

unaryInterceptorMethod · 0.92
SetHeaderFunction · 0.85
SendHeaderFunction · 0.85
SetSendCompressorFunction · 0.85
SetTrailerFunction · 0.85
MethodFunction · 0.85
TestStreamContextMethod · 0.85

Calls 1

ValueMethod · 0.45

Tested by 1

TestStreamContextMethod · 0.68