presence
Presence information for rooms of people persisted in crdt
Example
var Document = var presence = // todo document thisvar room = var doc = Document var rooms =
There are two types of rows that will be added to crdt for the sake of maintaing presence information, the first is the room
id: "presence~room~" + roomid || host: roomhost || {} type: "presence~room" ts: Date
and the second is for the people
id: "presence~person~" + personid roomId: roomid online: Boolean ts: Date /* other properties that are on person objects */ type: "presence~person"
The contract for room
input is that it's an object with a host
property and a people reducible representing a stream of people
data.
The contract for people is that they look like
id: "some id" ts: Date online: Boolean
It's your job to have a stream of people data, the online flag is
used to indicate whether someone is online. the id is used for
identity and ts is used by cleanse
to cleanse any people who
havn't updated their ts recently (i.e. heartbeating)
Installation
npm install presence
Contributors
- Raynos