We have three levels of identity as enumerated below. Note that these form a hierarchy: a particular user may be logged on using multiple browsers which in turn may have multiple SWISH windows opened.
wsid_status(+WSID, -Status)
retract(wsid_status(+WSID, -Status))
assertz(wsid_status(+WSID, +Status))
retractall(wsid_status(+WSID, _))
gitty
lost(Time)
if we lost contact at Time or unload
if the websocket was cleanly disconnected.
The Redis version keeps two keys per WSID as described below. Note that these keys only exist on temporary lost or disconnecting websockets.
unload
and this status is removed.Redis data:
at(Consumer,Session)
channel:SubChannel --> set(WSID-Channel)
subscription:WSID --> set(Channel-SubChannel)
icons/avatar.svg
#NNN`, which NNN is a
bitmask on the SVG to change its appearance,session_lost_timeout
seconds.
This also updates active_wsid/2 to reflect the current status.
uid
field.
Data always contains an avatar
key and optionally contains a
name
and email
key. If the avatar is generated there is also
a key avatar_generated
with the value true
.
Not really. A new user gets a new avatar and this is based on whether or not the file exists. Probably we should maintain a db of handed out avatars and their last-use time stamp. How to do that? Current swish stats: 400K avatars, 3.2Gb data.
swish:chat
pubsub channel and listening for
swish:chat
calls chat_broadcast_local/1,2 in each instance.
volatile
property it is broadcasted, but not stored.http
.The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
swish:chat
pubsub channel and listening for
swish:chat
calls chat_broadcast_local/1,2 in each instance.