Contexts in GRPC.
| Modifier and Type | Class and Description |
|---|---|
| private static class | Contexts.ContextualizedServerCallListener<ReqT>
Implementation of |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <ReqT, RespT> ServerCall. | Returns: listener that will receive events in the scope of the provided context.to make context, ServerCall<ReqT, RespT> Context#current().used to send responses to client. call, Metadata received from client. headers, ServerCallHandler<ReqT, RespT> handler used to create the listener to be wrapped. next)Make the provided |
| public static Status | statusFromCancelled(Context context)
Returns the |
| Contexts | back to summary |
|---|---|
| private Contexts() | |
| interceptCall | back to summary |
|---|---|
| public static <ReqT, RespT> ServerCall. Make the provided This utility is expected to be used by
| |
| statusFromCancelled | back to summary |
|---|---|
| public static Status statusFromCancelled(Context context) Returns the
| |
io.grpc.ForwardingServerCallListener that attaches a context before
dispatching calls to the delegate and detaches them after the call completes.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | onCancel()
Overrides io. |
| public void | onComplete()
Overrides io. onCancel is guaranteed not to be called.
|
| public void | onHalfClose()
Overrides io. |
| public void | onMessage(ReqT
a received request message. message)
A request message has been received.
|
| public void | onReady()
Overrides io. sendMessage) without requiring excessive buffering internally.
|
| context | back to summary |
|---|---|
| private final Context context | |
| ContextualizedServerCallListener | back to summary |
|---|---|
| public ContextualizedServerCallListener(ServerCall. | |
| onCancel | back to summary |
|---|---|
| public void onCancel() Overrides io. Doc from io. The call was cancelled and the server is encouraged to abort processing to save resources, since the client will not process any further messages. Cancellations can be caused by timeouts, explicit cancellation by the client, network errors, etc. There will be no further callbacks for the call.
| |
| onComplete | back to summary |
|---|---|
| public void onComplete() Overrides io. Doc from io. The call is considered complete and There will be no further callbacks for the call.
| |
| onHalfClose | back to summary |
|---|---|
| public void onHalfClose() Overrides io. Doc from io. The client completed all message sending. However, the call may still be cancelled.
| |
| onMessage | back to summary |
|---|---|
| public void onMessage(ReqT message) Overrides io. Doc from io. A request message has been received. For streaming calls, there may be zero or more request messages.
| |
| onReady | back to summary |
|---|---|
| public void onReady() Overrides io. Doc from io. This indicates that the call may now be capable of sending additional messages (via
Because there is a processing delay to deliver this notification, it is possible for
concurrent writes to cause
| |