Permalink
Browse files

Namespace requests in riak, include meta in event.

  • Loading branch information...
1 parent 75d78d1 commit 0d9dd0ed32e9b86027f031479891da10f5f42ba3 @roidrage roidrage committed Nov 13, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/http-request.js
View
@@ -9,7 +9,8 @@ var HttpRequest = function HttpRequest(client, meta) {
method: (meta.method || "").toLowerCase(),
path: meta.path,
started_at: new Date(),
- uuid: this._uuid()
+ uuid: this._uuid(),
+ meta: meta
}
}
@@ -26,7 +27,7 @@ HttpRequest.prototype.execute = function() {
if (meta.logger) meta.logger.write('[riak-js] ' + meta.method.toUpperCase() + ' ' + meta.path + '\n');
- this.client.emit('request.start', this.event)
+ this.client.emit('riak.request.start', this.event)
var request = http.request(meta, function(response) {
var headers = response.headers,
@@ -89,13 +90,13 @@ HttpRequest.prototype.execute = function() {
err = self.handleError(buffer);
}
- self.client.emit('request.finished', this.event);
+ self.client.emit('riak.request.finished', this.event);
callback(err, buffer, meta);
});
});
request.on('error', function(err) {
- self.client.emit('request.error', this.event)
+ self.client.emit('riak.request.error', this.event)
self.client.emit('error', err);
});

0 comments on commit 0d9dd0e

Please sign in to comment.