Vik.Presence (Vik v0.0.1-rc1)

View Source

Enables live awareness features in collaborative contexts.

Summary

Functions

Counts the amount of active participants in a session.

Callback implementation for Phoenix.Presence.list/1.

Returns a list of all active participants in a session.

Subscribes to room join/leaves.

Callback implementation for Phoenix.Presence.track/3.

Unsubscribes from room join/leaves.

Callback implementation for Phoenix.Presence.untrack/2.

Functions

child_spec(opts)

count_participants(suid)

@spec count_participants(Vik.Authority.suid()) :: :ok | :error

Counts the amount of active participants in a session.

fetchers_pids()

get_by_key(topic, key)

Callback implementation for Phoenix.Presence.get_by_key/2.

list(topic)

Callback implementation for Phoenix.Presence.list/1.

list_participants(suid)

@spec list_participants(Vik.Authority.suid()) :: :ok | :error

Returns a list of all active participants in a session.

subscribe(suid)

@spec subscribe(Vik.Authority.suid()) :: :ok | :error
@spec subscribe(Vik.Authority.suid()) :: :ok | :error

Subscribes to room join/leaves.

Message format

  • {:join, suid, ~m{id, name, metas}}
  • {:leave, suid, ~m{id, name, metas}}

track(socket, key, meta)

Callback implementation for Phoenix.Presence.track/3.

track(pid, topic, key, meta)

Callback implementation for Phoenix.Presence.track/4.

unsubscribe(suid)

Unsubscribes from room join/leaves.

untrack(socket, key)

Callback implementation for Phoenix.Presence.untrack/2.

untrack(pid, topic, key)

Callback implementation for Phoenix.Presence.untrack/3.

update(socket, key, meta)

Callback implementation for Phoenix.Presence.update/3.

update(pid, topic, key, meta)

Callback implementation for Phoenix.Presence.update/4.