Streams.Message.Total Class
Methods related to working with messageTotals of different message types in a stream
Methods
get
-
publisherId
-
streamName
-
messageType
-
callback
Get one or more messageTotals, which may result in batch requests to the server. May call Streams.Message.Total.get.onError if an error occurs.
Parameters:
-
publisherId
String -
streamName
String -
messageType
String | Arraycan be the message type, or an array of them
-
callback
FunctionThis receives two parameters. The first is the error. If messageType was a String, then the second parameter is the messageTotal. If messageType was an Array, then the second parameter is a hash of {messageType: messageTotal} pairs
latest
-
publisherId
-
streamName
-
messageType
Returns the latest total number of messages (of a certain type) posted to the stream
Returns:
setUpElement
-
element
-
publisherId
-
streamName
-
messageType
-
key
-
[options]
Sets up an element to show the total number of unseen messages (of a certain type) from a stream, and update the display in real time.
Parameters:
-
element
ElementThe element to set up
-
publisherId
StringThe id of the publisher
-
streamName
StringThe stream name
-
messageType
StringThe type of the message
-
key
String | Q.Tool | TrueKey for attaching the events
-
[options]
Object optional-
[unseenClass]
String optionalAdded if there is at least one unseen message
-
unseen
-
publisherId
-
streamName
-
messageType
Returns the latest number of unseen messages (of a certain type) posted to the stream
Parameters:
Returns:
Returns the number of unseen messages if there is a latest messageTotal, otherwise null.
Events
get.onError
Occurs when MTotal.get encounters an error loading a messageTotal from the server