ArchAstro. Channels. ApiObject
(archastro v0.2.0)
Copy Markdown
Channel for real-time custom object collaboration.
Clients join api:object:{object_id} to receive the current object state
and subscribe to field-level updates. Mutations are sent as key:value maps.
Summary
Functions
join_by_id(socket, object_id, params \\ %ArchAstro.Types.ChannelPayloads.ApiObjectChannel.JoinById.Params{})
@spec join_by_id( GenServer.server(), String.t(), ArchAstro.Types.ChannelPayloads.ApiObjectChannel.JoinById.Params.t() ) :: {:ok, ArchAstro.Channel.t()} | {:error, ArchAstro.Error.reason()}
join_by_row_key(socket, schema_type, row_key, params \\ %ArchAstro.Types.ChannelPayloads.ApiObjectChannel.JoinByRowKey.Params{})
@spec join_by_row_key( GenServer.server(), String.t(), String.t(), ArchAstro.Types.ChannelPayloads.ApiObjectChannel.JoinByRowKey.Params.t() ) :: {:ok, ArchAstro.Channel.t()} | {:error, ArchAstro.Error.reason()}
@spec leave(ArchAstro.Channel.t()) :: :ok | {:error, ArchAstro.Error.reason()}
@spec presence_update( ArchAstro.Channel.t(), ArchAstro.Types.ChannelPayloads.ApiObjectChannel.PresenceUpdate.Input.t(), timeout() ) :: {:ok, ArchAstro.Types.ChannelPayloads.ApiObjectChannel.PresenceUpdate.Response.t()} | {:error, ArchAstro.Error.reason()}
@spec save(ArchAstro.Channel.t(), timeout()) :: {:ok, ArchAstro.Types.ChannelPayloads.ApiObjectChannel.Save.Response.t()} | {:error, ArchAstro.Error.reason()}
@spec subscribe_access_revoked(ArchAstro.Channel.t(), pid()) :: :ok
@spec subscribe_object_created(ArchAstro.Channel.t(), pid()) :: :ok
@spec subscribe_object_deleted(ArchAstro.Channel.t(), pid()) :: :ok
@spec subscribe_object_updated(ArchAstro.Channel.t(), pid()) :: :ok
@spec subscribe_presence_left(ArchAstro.Channel.t(), pid()) :: :ok
@spec subscribe_presence_updated(ArchAstro.Channel.t(), pid()) :: :ok
@spec update_fields( ArchAstro.Channel.t(), ArchAstro.Types.ChannelPayloads.ApiObjectChannel.UpdateFields.Input.t(), timeout() ) :: {:ok, ArchAstro.Types.ChannelPayloads.ApiObjectChannel.UpdateFields.Response.t()} | {:error, ArchAstro.Error.reason()}