Skip to content

Commit

Permalink
Not so verbose.
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Lecarme <mathieu.lecarme@af83.com>
  • Loading branch information
Mathieu Lecarme committed Jan 15, 2012
1 parent 18fb817 commit 680cc36
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/triangle/front.js
Expand Up @@ -11,10 +11,10 @@ var web = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
var job_id = cluster.work('working', 'something long', ['hello', 'world'],
cluster.self(), function(err, resp) {
console.log('async job sent', resp);
//console.log('async job sent', resp);
});
cluster.on('id:something long:' + job_id, function() {
console.log('call back', arguments);
//console.log('call back', arguments);
res.end('Hello World\n');
});
});
Expand Down
2 changes: 1 addition & 1 deletion examples/triangle/worker.js
Expand Up @@ -6,7 +6,7 @@ var cluster = cluster_lib.createCluster();
cluster.queues.push('working');

cluster.worker.on('something long', function(args, respond_to, job_id) {
console.log('worker got some args', args);
//console.log('worker got some args', args);
cluster.answer(respond_to, 'something long', job_id, ['done'], function(err, resp) {
});
});
Expand Down
3 changes: 0 additions & 3 deletions lib/cluster.js
Expand Up @@ -15,11 +15,9 @@ var Cluster = function(_port, _address) {
this._id = 0;
var that = this;
this.server = redisd.createServer(function(command) {
console.log('command', command);
if (command[0] == 'info') {
this.encode('redis_version:2.4.5');
} else {
console.log(command);
that.emit('id:' + command[0] + ':' + command[1], command);
this.singleline('OK');
}
Expand Down Expand Up @@ -98,7 +96,6 @@ Cluster.prototype.work_loop = function() {
if (resp) {
var args = JSON.parse(resp[1]);
var f = args.shift();
console.log('work loop args', args);
w.worker.emit(f, args[0], args[1], args[2]);
}
if (resp) {
Expand Down

0 comments on commit 680cc36

Please sign in to comment.