Package io.grpc.netty
Class NettyServerStream
java.lang.Object
io.grpc.internal.AbstractStream
io.grpc.internal.AbstractServerStream
io.grpc.netty.NettyServerStream
- All Implemented Interfaces:
MessageFramer.Sink
,ServerStream
,Stream
Server stream for a Netty HTTP2 transport. Must only be called from the sending application
thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
static class
This should only be called from the transport thread. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Attributes
private final String
private static final Logger
private final NettyServerStream.Sink
private final NettyServerStream.TransportState
private final int
private final WriteQueue
-
Constructor Summary
ConstructorsConstructorDescriptionNettyServerStream
(io.netty.channel.Channel channel, NettyServerStream.TransportState state, Attributes transportAttrs, String authority, StatsTraceContext statsTraceCtx) -
Method Summary
Modifier and TypeMethodDescriptionprotected NettyServerStream.Sink
Sink for transport to be called to perform outbound operations.Attributes describing stream.Gets the authority this stream is addressed to.int
streamId()
The HTTP/2 stream id, or-1
if not supported.protected NettyServerStream.TransportState
Obtain the transport state corresponding to this stream.Methods inherited from class io.grpc.internal.AbstractServerStream
cancel, close, deliverFrame, framer, isReady, setDecompressor, setListener, setOnReadyThreshold, statsTraceContext, writeHeaders
Methods inherited from class io.grpc.internal.AbstractStream
endOfMessages, flush, onSendingBytes, optimizeForDirectExecutor, request, setCompressor, setMessageCompression, writeMessage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.grpc.internal.Stream
flush, optimizeForDirectExecutor, request, setCompressor, setMessageCompression, writeMessage
-
Field Details
-
log
-
sink
-
state
-
writeQueue
-
attributes
-
authority
-
streamId
private final int streamId
-
-
Constructor Details
-
NettyServerStream
public NettyServerStream(io.netty.channel.Channel channel, NettyServerStream.TransportState state, Attributes transportAttrs, String authority, StatsTraceContext statsTraceCtx)
-
-
Method Details
-
transportState
Description copied from class:AbstractStream
Obtain the transport state corresponding to this stream. Each stream must have its own unique transport state.- Specified by:
transportState
in classAbstractServerStream
-
abstractServerStreamSink
Description copied from class:AbstractServerStream
Sink for transport to be called to perform outbound operations. Each stream must have its own unique sink.- Specified by:
abstractServerStreamSink
in classAbstractServerStream
-
getAttributes
Description copied from interface:ServerStream
Attributes describing stream. This is inherited from the transport attributes, and used as the basis ofServerCall.getAttributes()
.- Specified by:
getAttributes
in interfaceServerStream
- Overrides:
getAttributes
in classAbstractServerStream
- Returns:
- Attributes container
-
getAuthority
Description copied from interface:ServerStream
Gets the authority this stream is addressed to.- Specified by:
getAuthority
in interfaceServerStream
- Overrides:
getAuthority
in classAbstractServerStream
- Returns:
- the authority string.
null
if not available.
-
streamId
public int streamId()Description copied from interface:ServerStream
The HTTP/2 stream id, or-1
if not supported.
-