Package com.codename1.backend.grpc
package com.codename1.backend.grpc
gRPC for the backend: the length-prefixed message framing, the status codes and the header encodings gRPC adds on top of HTTP/2.
GrpcFrames reassembles messages from the bytes of
a stream, GrpcStatus names the codes a call ends
with, and GrpcMetadata handles grpc-timeout,
grpc-message and binary -bin metadata.
-
ClassDescriptionA gRPC client: calls the methods of a server over HTTP/2.GrpcChannel.Call<Q,
R> One call in progress: send requests, end them, read responses.What a gRPC handler can learn about its call and add to the answer: the request metadata, the deadline, whether the client went away, and response headers and trailers.A failed gRPC call: a status code other thanGrpcStatus.OKand the message that goes with it.The gRPC length-prefixed message framing: every message on a gRPC stream is one byte of flags (bit 0 set when the message is compressed), a four-byte big-endian length, and that many bytes of payload.Reassembles messages from bytes as they arrive.The encodings gRPC layers on top of HTTP/2 headers: thegrpc-timeoutdeadline, the percent-encodedgrpc-message, and binary metadata in headers whose name ends in-bin.One method aGrpcServerserves: its path, its shape, the codecs of its messages and the code that runs it.Runs a bidirectional streaming method.Runs a client streaming method.Runs a server streaming method.Runs a unary method.Serves gRPC: native gRPC over HTTP/2, and gRPC-Web over HTTP/1.1 or HTTP/2 for browsers and for the Codename One client'sGrpcWeb.The HTTP side of one gRPC call on the server, implemented by the HTTP server for an HTTP/2 stream and byGrpcServerfor gRPC-Web over HTTP/1.1.The gRPC status codes, as they travel in thegrpc-statustrailer.Receives the messages of a stream: the responses a streaming handler sends, or the responses a client reads from a streaming call.