Issho.Presence (Issho v0.1.0)

Copy Markdown View Source

Who is in a room: Phoenix.Presence, as it is, on your app's PubSub.

Issho starts it for you (the instance's :presence option, true unless given) and tracks each session under its actor's key, so an actor in two tabs is one entry with two metas. Each meta is the actor's public identity (Issho.Identity.public/1) and when it joined.

Presence is for who is here, which changes when people come and go. Where they are changes many times a second and goes through awareness (Issho.Awareness), which is not replicated by Presence's CRDT.

An app with several Issho instances on one node gives each a presence: false but the first, and they share this one.

Summary

Functions

Callback implementation for Phoenix.Presence.fetch/2.

Callback implementation for Phoenix.Presence.list/1.

The actors in a room: their keys and public identities.

Callback implementation for Phoenix.Presence.track/3.

Callback implementation for Phoenix.Presence.untrack/2.

Functions

child_spec(opts)

fetch(topic, presences)

Callback implementation for Phoenix.Presence.fetch/2.

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.

people(room)

@spec people(String.t()) :: %{required(String.t()) => map()}

The actors in a room: their keys and public identities.

track(socket, key, meta)

Callback implementation for Phoenix.Presence.track/3.

track(pid, topic, key, meta)

Callback implementation for Phoenix.Presence.track/4.

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.