ProtoRune.Firehose.Frame (proto_rune v0.5.1)

Copy Markdown

Decodes firehose WebSocket frames into ProtoRune.Firehose.Event structs.

Each frame received on com.atproto.sync.subscribeRepos is the concatenation of two CBOR objects: a header and a message-specific payload. Regular messages carry %{"op" => 1, "t" => "#commit"}-style headers, while %{"op" => -1} headers signal error frames.

Summary

Functions

Decodes a binary WebSocket frame into an event.

Functions

decode(data)

@spec decode(binary()) ::
  {:ok, ProtoRune.Firehose.Event.t()} | {:error, atom() | tuple()}

Decodes a binary WebSocket frame into an event.