View Source Appwrite.Types.Client.Realtime (appwrite v0.1.9)

Struct representing the structure of a realtime communication object.

Summary

Functions

Cleans up resources associated with specified channels.

Establishes a WebSocket connection.

Gets the timeout duration for communication operations.

Initializes a new Realtime struct with default values.

Handles incoming messages from the WebSocket connection.

Types

t()

@type t() :: %Appwrite.Types.Client.Realtime{
  channels: MapSet.t(String.t()),
  last_message: Appwrite.Types.Client.RealtimeResponse.t() | nil,
  reconnect: boolean(),
  reconnect_attempts: non_neg_integer(),
  socket: WebSocket.t() | nil,
  subscriptions: %{
    required(integer()) => %{
      channels: [String.t()],
      callback: (Appwrite.Types.Client.RealtimeResponseEvent.t() -> any())
    }
  },
  subscriptions_counter: non_neg_integer(),
  timeout: non_neg_integer() | nil,
  url: String.t() | nil
}

Functions

clean_up(realtime, channels)

Cleans up resources associated with specified channels.

connect(realtime)

Establishes a WebSocket connection.

get_timeout(realtime)

Gets the timeout duration for communication operations.

new(attrs \\ %{})

Initializes a new Realtime struct with default values.

on_message(realtime, message_event)

Handles incoming messages from the WebSocket connection.