mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
feature(util) mv addListener, removeListener from cloudfunc
This commit is contained in:
parent
e7dad86f91
commit
5e12b475bb
4 changed files with 77 additions and 60 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue