Package io.grpc.netty
Class NettyClientStream
- java.lang.Object
-
- io.grpc.internal.AbstractStream
-
- io.grpc.internal.AbstractClientStream
-
- io.grpc.netty.NettyClientStream
-
- All Implemented Interfaces:
ClientStream
,MessageFramer.Sink
,Stream
class NettyClientStream extends AbstractClientStream
Client stream for a Netty transport. Must only be called from the sending application thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
NettyClientStream.Sink
static class
NettyClientStream.TransportState
This should only be called from the transport thread.
-
Field Summary
Fields Modifier and Type Field Description private io.netty.util.AsciiString
authority
private MethodDescriptor<?,?>
method
private static InternalMethodDescriptor
methodDescriptorAccessor
private io.netty.util.AsciiString
scheme
private NettyClientStream.Sink
sink
private NettyClientStream.TransportState
state
private io.netty.util.AsciiString
userAgent
private WriteQueue
writeQueue
-
Constructor Summary
Constructors Constructor Description NettyClientStream(NettyClientStream.TransportState state, MethodDescriptor<?,?> method, Metadata headers, io.netty.channel.Channel channel, io.netty.util.AsciiString authority, io.netty.util.AsciiString scheme, io.netty.util.AsciiString userAgent, StatsTraceContext statsTraceCtx, TransportTracer transportTracer, CallOptions callOptions, boolean useGetForSafeMethods)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NettyClientStream.Sink
abstractClientStreamSink()
Sink for transport to be called to perform outbound operations.Attributes
getAttributes()
Attributes that the stream holds at the current moment.void
setAuthority(java.lang.String authority)
Override the default authority withauthority
.protected NettyClientStream.TransportState
transportState()
Obtain the transport state corresponding to this stream.-
Methods inherited from class io.grpc.internal.AbstractClientStream
appendTimeoutInsight, cancel, deliverFrame, framer, getTransportTracer, halfClose, isReady, setDeadline, setDecompressorRegistry, setFullStreamDecompression, setMaxInboundMessageSize, setMaxOutboundMessageSize, shouldBeCountedForInUse, start
-
Methods inherited from class io.grpc.internal.AbstractStream
endOfMessages, flush, onSendingBytes, optimizeForDirectExecutor, request, setCompressor, setMessageCompression, setOnReadyThreshold, 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 Detail
-
methodDescriptorAccessor
private static final InternalMethodDescriptor methodDescriptorAccessor
-
sink
private final NettyClientStream.Sink sink
-
state
private final NettyClientStream.TransportState state
-
writeQueue
private final WriteQueue writeQueue
-
method
private final MethodDescriptor<?,?> method
-
authority
private io.netty.util.AsciiString authority
-
scheme
private final io.netty.util.AsciiString scheme
-
userAgent
private final io.netty.util.AsciiString userAgent
-
-
Constructor Detail
-
NettyClientStream
NettyClientStream(NettyClientStream.TransportState state, MethodDescriptor<?,?> method, Metadata headers, io.netty.channel.Channel channel, io.netty.util.AsciiString authority, io.netty.util.AsciiString scheme, io.netty.util.AsciiString userAgent, StatsTraceContext statsTraceCtx, TransportTracer transportTracer, CallOptions callOptions, boolean useGetForSafeMethods)
-
-
Method Detail
-
transportState
protected NettyClientStream.TransportState transportState()
Description copied from class:AbstractClientStream
Obtain the transport state corresponding to this stream. Each stream must have its own unique transport state.- Specified by:
transportState
in classAbstractClientStream
-
abstractClientStreamSink
protected NettyClientStream.Sink abstractClientStreamSink()
Description copied from class:AbstractClientStream
Sink for transport to be called to perform outbound operations. Each stream must have its own unique sink.- Specified by:
abstractClientStreamSink
in classAbstractClientStream
-
setAuthority
public void setAuthority(java.lang.String authority)
Description copied from interface:ClientStream
Override the default authority withauthority
. May only be called beforeClientStream.start(io.grpc.internal.ClientStreamListener)
.
-
getAttributes
public Attributes getAttributes()
Description copied from interface:ClientStream
Attributes that the stream holds at the current moment. Thread-safe and can be called at any time, although some attributes are there only after a certain point.
-
-