Subscribing to any system services

edited May 2014 in Enyo 2.4
I am working on a network-based application. As a part of checking functionality, if suppose no network connection available, then my application should respond back with a pop up message mentioning network not connected.

As this application is based on network, before fetching anything from network, i am placing a system call to check whether network is connected or not. Well this takes time as everytime i need to make service call.

I was thinking about whether there is some way to subscribing to system services available in enyo, where i can subscribe to network service and know whenever there is change in network, i should trigger call to some function which display error message on a pop up. Following is the kind i am setting before placing any fetch data request:

enyo.kind({
name:"app.Connected",
kind:"enyo.Collection",
service:"palm://com.palm.connectionmanager/",
method:"getstatus",
fetch:function(opts){
this.inherited(arguments);
},
parse:function(data){
console.log(data);
}
});

Comments

Sign In or Register to comment.