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{})

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

leave(channel)

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

presence_update(channel, payload, timeout \\ 5000)

save(channel, timeout \\ 5000)

subscribe_access_revoked(channel, subscriber \\ self())

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

subscribe_object_created(channel, subscriber \\ self())

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

subscribe_object_deleted(channel, subscriber \\ self())

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

subscribe_object_updated(channel, subscriber \\ self())

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

subscribe_presence_left(channel, subscriber \\ self())

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

subscribe_presence_updated(channel, subscriber \\ self())

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

update_fields(channel, payload, timeout \\ 5000)