var p = new PluginInterface();
p.on('test', function (event, data) {
data.a += '!';
- event.callback();
+});
+
+p.on('test', function (event, data) {
+ data.wait = true;
+ setTimeout(function() {
+ data.a += '!';
+ event.callback();
+ }, 1000);
});
p.emit('test', {a: 'hello world'}).then(function (data) {
var p = new PluginInterface();
p.on('test', function (event, data) {
data.a += '!';
- event.callback();
+});
+
+p.on('test', function (event, data) {
+ data.wait = true;
+ setTimeout(function() {
+ data.a += '!';
+ event.callback();
+ }, 1000);
});
p.emit('test', {a: 'hello world'}).then(function (data) {
// A web client is connected
module.on('client created', function(event, data) {
console.log('[client connection]', data);
- event.callback();
});
// The Client recieves a IRC PRIVMSG command
module.on('irc message', function(event, data) {
console.log('[MESSAGE]', data.irc_event);
- event.callback();
});
// The Client recieves a IRC USER NOTICE command
module.on('irc user notice', function(event, data) {
console.log('[NOTICE]', data.irc_event);
- event.callback();
});
// The client recieves an IRC JOIN command
module.on('irc channel join', function(event, data) {
console.log('[JOIN]', data.irc_event);
- event.callback();
});
console.log('[CLIENT COMMAND]', client_method);
console.log(' ', client_args);
- event.callback();
});
ignored_events.push('http.request');
if (ignored_events.indexOf(stat_name) > -1) {
- return event.callback();
+ return;
}
timestamp = Math.floor((new Date()).getTime() / 1000);
stats_file.write(timestamp.toString() + ' ' + stat_name + '\n');
-
- event.callback();
});