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.

  • Class
    Description
    A gRPC client: calls the methods of a server over HTTP/2.
    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 than GrpcStatus.OK and 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: the grpc-timeout deadline, the percent-encoded grpc-message, and binary metadata in headers whose name ends in -bin.
    One method a GrpcServer serves: 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's GrpcWeb.
    The HTTP side of one gRPC call on the server, implemented by the HTTP server for an HTTP/2 stream and by GrpcServer for gRPC-Web over HTTP/1.1.
    The gRPC status codes, as they travel in the grpc-status trailer.
    Receives the messages of a stream: the responses a streaming handler sends, or the responses a client reads from a streaming call.