GrpcProtocol

org.apache.pekko.grpc.GrpcProtocol
See theGrpcProtocol companion trait
@InternalApi
object GrpcProtocol

INTERNAL API

Core definitions for gRPC protocols.

Attributes

Companion
trait
Source
GrpcProtocol.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class DataFrame(data: ByteString) extends Frame

A data (or message) frame in a gRPC protocol stream.

A data (or message) frame in a gRPC protocol stream.

Attributes

Source
GrpcProtocol.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Frame
class Object
trait Matchable
class Any
Show all
sealed trait Frame

A frame in a logical gRPC protocol stream

A frame in a logical gRPC protocol stream

Attributes

Source
GrpcProtocol.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class DataFrame
class TrailerFrame
case class GrpcProtocolReader(messageEncoding: Codec, decodeSingleFrame: ByteString => ByteString, frameDecoder: Flow[ByteString, Frame, NotUsed])

Implements the decoding of the gRPC framing from a physical/transport layer.

Implements the decoding of the gRPC framing from a physical/transport layer.

Attributes

Source
GrpcProtocol.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class GrpcProtocolWriter(contentType: ContentType, messageEncoding: Codec, encodeFrame: Frame => ChunkStreamPart, encodeDataToResponse: (ByteString, Seq[HttpHeader], Trailer) => HttpResponse, frameEncoder: Flow[Frame, ChunkStreamPart, NotUsed])

Implements the encoding of a stream of gRPC Frames into a physical/transport layer.

Implements the encoding of a stream of gRPC Frames into a physical/transport layer.

This maps the logical gRPC frames into a stream of chunks that can be handled by the HTTP/2 or HTTP/1.1 transport layer.

Attributes

Source
GrpcProtocol.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class TrailerFrame(trailers: List[HttpHeader]) extends Frame

A trailer (status headers) frame in a gRPC protocol stream

A trailer (status headers) frame in a gRPC protocol stream

Attributes

Source
GrpcProtocol.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Frame
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def detect(request: HttpRequest): Option[GrpcProtocol]

Detects which gRPC protocol variant is indicated in a request.

Detects which gRPC protocol variant is indicated in a request.

Attributes

Returns

a GrpcProtocol matching the request mediatype if specified and known.

Source
GrpcProtocol.scala
def detect(mediaType: MediaType): Option[GrpcProtocol]

Detects which gRPC protocol variant is indicated by a mediatype.

Detects which gRPC protocol variant is indicated by a mediatype.

Attributes

Returns

a GrpcProtocol matching the request mediatype if known.

Source
GrpcProtocol.scala
def negotiate(request: HttpRequest): Option[(Try[GrpcProtocolReader], GrpcProtocolWriter)]

Calculates the gRPC protocol encoding to use for an interaction with a gRPC client.

Calculates the gRPC protocol encoding to use for an interaction with a gRPC client.

Value parameters

request

the client request to respond to.

Attributes

Returns

the protocol reader for the request, and a protocol writer for the response.

Source
GrpcProtocol.scala