ArchAstro.SDK.Channels.ApiObject (archastro v0.3.3)

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.SDK.Types.ChannelPayloads.ApiObjectChannel.JoinById.Params{})

join_by_row_key(socket, schema_type, row_key, params \\ %ArchAstro.SDK.Types.ChannelPayloads.ApiObjectChannel.JoinByRowKey.Params{})

leave(channel)

@spec leave(ArchAstro.SDK.Channel.t()) :: :ok | {:error, ArchAstro.SDK.Error.reason()}

presence_update(channel, payload, timeout \\ 5000)

save(channel, timeout \\ 5000)

subscribe_access_revoked(channel, subscriber \\ self())

@spec subscribe_access_revoked(ArchAstro.SDK.Channel.t(), pid()) :: :ok

subscribe_object_created(channel, subscriber \\ self())

@spec subscribe_object_created(ArchAstro.SDK.Channel.t(), pid()) :: :ok

subscribe_object_deleted(channel, subscriber \\ self())

@spec subscribe_object_deleted(ArchAstro.SDK.Channel.t(), pid()) :: :ok

subscribe_object_updated(channel, subscriber \\ self())

@spec subscribe_object_updated(ArchAstro.SDK.Channel.t(), pid()) :: :ok

subscribe_presence_left(channel, subscriber \\ self())

@spec subscribe_presence_left(ArchAstro.SDK.Channel.t(), pid()) :: :ok

subscribe_presence_updated(channel, subscriber \\ self())

@spec subscribe_presence_updated(ArchAstro.SDK.Channel.t(), pid()) :: :ok

update_fields(channel, payload, timeout \\ 5000)