feature(util) mv addListener, removeListener from cloudfunc

This commit is contained in:
coderaiser 2014-07-01 04:24:04 -04:00
parent e7dad86f91
commit 5e12b475bb
4 changed files with 77 additions and 60 deletions

View file

@ -2,8 +2,9 @@
'use strict';
var main = global.cloudcmd.main,
DIR = '../',
io = main.require('socket.io'),
CloudFunc = main.cloudfunc,
Util = require(DIR + 'util'),
AllListeners = [];
exports.on = addListener;
@ -17,11 +18,11 @@
if (!socket)
socket = io.sockets;
CloudFunc.addListener(name, func, AllListeners, socket);
Util.addListener(name, func, AllListeners, socket);
}
function removeListener(name, func, socket) {
CloudFunc.removeListener(name, func, AllListeners, socket);
Util.removeListener(name, func, AllListeners, socket);
}
function send(msg, socket) {