Interface ClientTransport
-
- All Superinterfaces:
InternalInstrumented<InternalChannelz.SocketStats>
,InternalWithLogId
- All Known Subinterfaces:
ConnectionClientTransport
,ManagedClientTransport
- All Known Implementing Classes:
CallCredentialsApplyingTransportFactory.CallCredentialsApplyingTransport
,DelayedClientTransport
,FailingClientTransport
,ForwardingConnectionClientTransport
,InProcessTransport
,InternalSubchannel.CallTracingTransport
,NettyClientTransport
@ThreadSafe public interface ClientTransport extends InternalInstrumented<InternalChannelz.SocketStats>
The client-side transport typically encapsulating a single connection to a remote server. However, streams created before the client has discovered any server address may eventually be issued on different connections. All methods on the transport and its callbacks are expected to execute quickly.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ClientTransport.PingCallback
A callback that is invoked when the acknowledgement to aping(io.grpc.internal.ClientTransport.PingCallback, java.util.concurrent.Executor)
is received.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClientStream
newStream(MethodDescriptor<?,?> method, Metadata headers, CallOptions callOptions, ClientStreamTracer[] tracers)
Creates a new stream for sending messages to a remote end-point.void
ping(ClientTransport.PingCallback callback, java.util.concurrent.Executor executor)
Pings a remote endpoint.-
Methods inherited from interface io.grpc.InternalInstrumented
getStats
-
Methods inherited from interface io.grpc.InternalWithLogId
getLogId
-
-
-
-
Method Detail
-
newStream
ClientStream newStream(MethodDescriptor<?,?> method, Metadata headers, CallOptions callOptions, ClientStreamTracer[] tracers)
Creates a new stream for sending messages to a remote end-point.This method returns immediately and does not wait for any validation of the request. If creation fails for any reason,
ClientStreamListener.closed(io.grpc.Status, io.grpc.internal.ClientStreamListener.RpcProgress, io.grpc.Metadata)
will be called to provide the error information. Any sent messages for this stream will be buffered until creation has completed (either successfully or unsuccessfully).This method is called under the
Context
of theClientCall
.- Parameters:
method
- the descriptor of the remote method to be called for this stream.headers
- to send at the beginning of the callcallOptions
- runtime options of the calltracers
- a non-empty array of tracers. The last element in it is reserved to be set by the load balancer's pick result and otherwise is a no-op tracer.- Returns:
- the newly created stream.
-
ping
void ping(ClientTransport.PingCallback callback, java.util.concurrent.Executor executor)
Pings a remote endpoint. When an acknowledgement is received, the given callback will be invoked using the given executor.Pings are not necessarily sent to the same endpoint, thus a successful ping only means at least one endpoint responded, but doesn't imply the availability of other endpoints (if there is any).
This is an optional method. Transports that do not have any mechanism by which to ping the remote endpoint may throw
UnsupportedOperationException
.
-
-