@ThreadSafe public interface ClientTransport extends InternalInstrumented<InternalChannelz.SocketStats>
Modifier and Type | Interface and Description |
---|---|
static interface |
ClientTransport.PingCallback
A callback that is invoked when the acknowledgement to a
ping(io.grpc.internal.ClientTransport.PingCallback, java.util.concurrent.Executor) is received. |
Modifier and Type | Method and Description |
---|---|
ClientStream |
newStream(MethodDescriptor<?,?> method,
Metadata headers,
CallOptions callOptions)
Creates a new stream for sending messages to a remote end-point.
|
void |
ping(ClientTransport.PingCallback callback,
Executor executor)
Pings a remote endpoint.
|
getStats
getLogId
ClientStream newStream(MethodDescriptor<?,?> method, Metadata headers, CallOptions callOptions)
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.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 the ClientCall
.
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 callvoid ping(ClientTransport.PingCallback callback, Executor executor)
Pings are not necessarily sent to the same endpont, 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
.
Copyright © 2018. All rights reserved.