BinaryEventStreamCodec

org.sigilaris.node.jvm.transport.armeria.gossip.BinaryEventStreamCodec

Binary codec for encoding and decoding streams of event envelopes in a compact frame format.

Each frame is length-prefixed and tagged with a version byte and kind byte, enabling efficient binary transport of gossip events over HTTP.

Attributes

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

Members list

Type members

Classlikes

final case class DecoderState

Incremental decoder state for length-prefixed binary event frames.

Incremental decoder state for length-prefixed binary event frames.

Attributes

Companion
object
Source
BinaryEventStreamCodec.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object DecoderState

Attributes

Companion
class
Source
BinaryEventStreamCodec.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def decode[A : ByteDecoder](bytes: Array[Byte]): Either[String, Vector[EventEnvelopeWire[A]]]

Decodes a binary frame byte array into a vector of event envelopes.

Decodes a binary frame byte array into a vector of event envelopes.

Type parameters

A

the event payload type

Value parameters

bytes

raw bytes to decode

Attributes

Returns

the decoded event envelopes, or an error message

Source
BinaryEventStreamCodec.scala
def decodeChunk[A : ByteDecoder](state: DecoderState, chunk: ByteVector): Either[String, (DecoderState, Vector[EventEnvelopeWire[A]])]

Decodes all complete frames available after appending chunk.

Decodes all complete frames available after appending chunk.

Partial frame bytes are retained in the returned state. Call finishDecode when the byte stream ends to surface a truncated final frame.

Attributes

Source
BinaryEventStreamCodec.scala
def decodeFrame[A : ByteDecoder](bytes: ByteVector): Either[String, EventEnvelopeWire[A]]

Decodes exactly one complete length-prefixed binary frame.

Decodes exactly one complete length-prefixed binary frame.

Attributes

Source
BinaryEventStreamCodec.scala
def decodeFrames[F[_], A](using evidence$1: ByteDecoder[A], ApplicativeError[F, Throwable]): (F, Byte) => EventEnvelopeWire[A]

Decodes an FS2 byte stream of length-prefixed frames incrementally.

Decodes an FS2 byte stream of length-prefixed frames incrementally.

Attributes

Source
BinaryEventStreamCodec.scala
def encode[A : ByteEncoder](events: Vector[EventEnvelopeWire[A]]): Either[String, Array[Byte]]

Encodes a vector of event envelopes into a binary frame byte array.

Encodes a vector of event envelopes into a binary frame byte array.

Type parameters

A

the event payload type

Value parameters

events

event envelopes to encode

Attributes

Returns

the encoded byte array, or an error message

Source
BinaryEventStreamCodec.scala
def encodeFrame[A : ByteEncoder](envelope: EventEnvelopeWire[A]): Either[String, ByteVector]

Encodes one event envelope as one length-prefixed binary frame.

Encodes one event envelope as one length-prefixed binary frame.

Attributes

Source
BinaryEventStreamCodec.scala
def encodeFrames[F[_], A](using evidence$1: ByteEncoder[A], ApplicativeError[F, Throwable]): (F, EventEnvelopeWire[A]) => Byte

Encodes event envelopes to an FS2 byte stream of length-prefixed frames.

Encodes event envelopes to an FS2 byte stream of length-prefixed frames.

Attributes

Source
BinaryEventStreamCodec.scala
def finishDecode(state: DecoderState): Either[String, Unit]

Validates that an incremental byte stream ended on a frame boundary.

Validates that an incremental byte stream ended on a frame boundary.

Attributes

Source
BinaryEventStreamCodec.scala

Concrete fields

val CurrentVersion: Byte

Current binary framing protocol version.

Current binary framing protocol version.

Attributes

Source
BinaryEventStreamCodec.scala
val MaxFrameSizeBytes: Long

Maximum allowed size in bytes for a single encoded event frame.

Maximum allowed size in bytes for a single encoded event frame.

Attributes

Source
BinaryEventStreamCodec.scala
val MediaType: String

MIME type for binary event stream responses.

MIME type for binary event stream responses.

Attributes

Source
BinaryEventStreamCodec.scala