Guava.Events (Guava v0.34.0)

Copy Markdown View Source

Server-to-client events received over a call's WebSocket connection.

Each event is a struct discriminated on the wire by event_type. Use decode/1 to turn a decoded JSON map into the matching struct.

Summary

Types

t()

Any event that can be received from the Guava server.

Functions

Decode a JSON map into an event struct.

Decode an event from a JSON string. Returns nil for unknown types.

Types

Functions

decode(m)

@spec decode(map()) :: t() | nil

Decode a JSON map into an event struct.

Returns nil (and logs a warning) for unknown event types, matching the Python SDK's forward-compatible behavior.

decode_json(json)

@spec decode_json(String.t() | binary()) :: t() | nil

Decode an event from a JSON string. Returns nil for unknown types.