/** * Subscribe to an event * @param {string} channel Event name * @param {object} subscription Module callback * @param {object} context Context in which to execute the module */obj.subscribe=function(channel,callback,context){channels[channel]=(!channels[channel])?[]:channels[channel];channels[channel].push(this.util.method(callback,context));};/** * Publish an event, passing arguments to subscribers. Will * call start if the channel is not already registered. * @param {string} channel Event name */obj.publish=function(channel){vari,l,args=[].slice.call(arguments,1);if(!channels[channel]){obj.start.apply(this,arguments);return;}for(i=0,l=channels[channel].length;i<l;i+=1){channels[channel][i].apply(this,args);}};