Package io.servicetalk.grpc.api
Interface GrpcServiceContext
- All Superinterfaces:
AsyncCloseable,ConnectionContext,ConnectionInfo,GrpcMetadata,ListenableAsyncCloseable
A gRPC service context.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.servicetalk.transport.api.ConnectionInfo
ConnectionInfo.Protocol -
Method Summary
Modifier and TypeMethodDescriptionGet theExecutionContextfor thisConnectionInfo.protocol()Get theConnectionInfo.Protocolfor thisConnectionInfo.default ContextMapA response context associated with thisGrpcMetadatathat translates intoHttpMetaData.context().Deprecated.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefullyMethods inherited from interface io.servicetalk.transport.api.ConnectionContext
parentMethods inherited from interface io.servicetalk.transport.api.ConnectionInfo
connectionId, localAddress, remoteAddress, socketOption, sslConfig, sslSession, toStringMethods inherited from interface io.servicetalk.grpc.api.GrpcMetadata
path, requestContextMethods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosing
-
Method Details
-
executionContext
GrpcExecutionContext executionContext()Description copied from interface:ConnectionInfoGet theExecutionContextfor thisConnectionInfo.The
ExecutionContext.ioExecutor()will represent the thread responsible for IO for thisConnectionInfo. Note that this maybe different that what was used to create this object because at this time a specificIoExecutorhas been selected.- Specified by:
executionContextin interfaceConnectionInfo- Returns:
- the
ExecutionContextfor thisConnectionInfo.
-
protocol
GrpcServiceContext.GrpcProtocol protocol()Description copied from interface:ConnectionInfoGet theConnectionInfo.Protocolfor thisConnectionInfo.- Specified by:
protocolin interfaceConnectionInfo- Returns:
- the
ConnectionInfo.Protocolfor thisConnectionInfo.
-
supportedMessageCodings
Deprecated.Will be removed along withContentCodec.TheContentCodeccodings available for this gRPC call.- Returns:
- the
ContentCodeccodings available for this gRPC call.
-
responseContext
A response context associated with thisGrpcMetadatathat translates intoHttpMetaData.context().Context can be used to associate a state with a response without serializing its state on the wire or transmit a state between HTTP and gRPC layers.
Notes:
- For asynchronous endpoints that operate with a
Publishereither for reading or writing data back, only modifications to theresponseContext()made before the endpoint method returns are visible for HTTPheaders. Any other modifications made from inside the asynchronous chain of operators or from inside thePublisher.defer(Supplier)operator will be visible only for HTTPtrailers. - For synchronous endpoints that operate with
BlockingStreamingGrpcServerResponse, only modifications to theresponseContext()made before invocation ofBlockingStreamingGrpcServerResponse.sendMetaData()method are visible for HTTPheaders. Any other modifications made later (while operating withGrpcPayloadWriter) will be visible only for HTTPtrailers.
- Specified by:
responseContextin interfaceGrpcMetadata- Returns:
- a response context associated with this
GrpcMetadatathat translates intoHttpMetaData.context().
- For asynchronous endpoints that operate with a
-
ContentCodec.