-
Notifications
You must be signed in to change notification settings - Fork 44
Message formats documentation
Sam Shull edited this page Nov 26, 2013
·
2 revisions
-
subscribe: adds listener for messages
publish
'ed to the givento
parameter{ op: 'subscribe', to: '{resourceType}:/{accountName}/{scope}' }
-
unsubscribe: removes listener added by subscribe
{ op: 'unsubscribe', to: '{resourceType}:/{accountName}/{scope}' }
-
get: get the values of a presence
-
{ op: 'get', to: 'presence:/{accountName}/{scope}' }
- sends Presence.Outgoing.get.Version 1 as response -
{ op: 'get', to: 'presence:/{accountName}/{scope}', options: { version: 2 } }
- sends Presence.Outgoing.get Version 2 as response
-
-
sync: subscribe to a presence and get the current presence values
-
{ op: 'sync', to: 'presence:/{accountName}/{scope}' }
- sends Presence.Outgoing.online sync response as response -
{ op: 'sync', to: 'presence:/{accountName}/{scope}', options: { version: 2 } }
- sends Presence.Outgoing.get Version 2 as response
-
-
online: a presence entry was added for a user
{ op: 'online', to: 'presence:/{accountName}/{scope}', value: {Object({ '{Number(userId)}': '{Number(userType)}' }) }, userData: {Object} }
-
online - sync response: sync on a presence results in
{ op: 'online', to: 'presence:/{accountName}/{scope}', value: {Object({ '{Number(userId)}': '{Number(userType)}' })} }
-
offline: all presence entries were removed for a user
{ op: 'offline', to: 'presence:/{accountName}/{scope}', value: { '{Number(userId)}': '{Number(userType)}' } }
-
client_online: a presence entry was added for a client that a user is using to communicate with Radar (multiple per user possible)
{ op: 'client_online', to: 'presence:/{accountName}/{scope}', value: { userId: {Number}, clientId: {String}, userData: {Object} } }
-
client_offline: the presence entry was removed for a client that a user is using to communicate with Radar
{ op: 'client_offline', to: 'presence:/{accountName}/{scope}', value: { userId: {Number}, clientId: {String} } }
-
get - Version 1: sent as a response to a Presence.Incoming.get operation
{ op: 'get', to: '{original name}', value: {Object({ '{Number(userId)}': '{Number(userType)}' })} }
-
get - Version 2: sent as a response to a Presence.Incoming.sync.Version 2 operation
{ op: 'get', to: '{original name}', value: {Object({ '{Number(userId)}': { userType: '{Number}', clients: {Object({ '{clientId}': '{userData || {}}' })} })}
-
get: sends Status.Outgoing.get as reciprocal
{ op: 'get', to: 'status:/{accountName}/{scope}' }
-
set:
{ op: 'set', to: 'status:/{accountName}/{scope}', value: {Object}, key: {Number | String}, type: {Number} }
-
sync: sends Status.Outgoing.get as reciprocal
{ op: 'sync', to: 'status:/{accountName}/{scope}' }
-
get:
{ op: 'get', to: '{name used in original request}', value: {Object({ {userId}: {value} })} }
-
sync: sends MessageList.Outgoing.sync as reciprocal message
{ op: 'sync', to: 'message:/{accountName}/{scope}' }
-
publish: sends a message to the listener(s) that are
subscribe
'ed{ op: 'publish', to: 'message:/{accountName}/{scope}', value: {Object} }
-
sync: sent as response to MessageList.Incoming.sync
{ op: 'sync', to: '{name used in original request}', time: Date.now(), value: [ {data, timestamp}* ] }