Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on the client side:
- function monitor(){
- dojo.xhr({
- method:"POST",
- url:"/TestCalls",
- headers:{
- "Accept":"message/json",
- "Content-Type":"message/json"
- },
- postData: dojo.toJson([{method:"subscribe", subscribe:"hour"}]),
- handleAs: "json"
- }).addCallback(function(results){
- dojo.forEach(results, dojox.data.restListener);
- monitor();
- });
- }
- monitor();
- in the model file on the server
- var hub = require("tunguska/hub");
- Model("TestCalls", store, {
- "put": function(object){
- object.groups.forEach(function(group){
- hub.publish("TestCalls/" + group, {event:"put", source:object.id, result: object});
- });
- ...
Add Comment
Please, Sign In to add comment