Add a key field to messages and allow lookup of most recent message by key.
This commit is contained in:
@@ -88,11 +88,15 @@ cosmopolite.Client.prototype.unsubscribe = function(subject) {
|
||||
});
|
||||
};
|
||||
|
||||
cosmopolite.Client.prototype.sendMessage = function(subject, message) {
|
||||
this.sendRPC_('sendMessage', {
|
||||
cosmopolite.Client.prototype.sendMessage = function(subject, message, key) {
|
||||
args = {
|
||||
'subject': subject,
|
||||
'message': message,
|
||||
});
|
||||
};
|
||||
if (key) {
|
||||
args['key'] = key;
|
||||
}
|
||||
this.sendRPC_('sendMessage', args);
|
||||
};
|
||||
|
||||
cosmopolite.Client.prototype.getMessages = function(subject) {
|
||||
|
||||
Reference in New Issue
Block a user