zookeeper-hd
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -9,3 +9,3 @@ // This file has been generated from coffee source files | ||
normalizeCallBack = function(onData) { | ||
normalizeCallBack = function(action, path, onData) { | ||
return function(resultCode, error, data1, data2) { | ||
@@ -15,3 +15,5 @@ if (resultCode !== 0) { | ||
rc: resultCode, | ||
msg: error | ||
msg: error, | ||
path: path, | ||
action: action | ||
}); | ||
@@ -54,3 +56,3 @@ } | ||
SimpleClient.prototype.create = function(zkPath, value, flags, onReady) { | ||
return this.client.a_create(this.fullPath(zkPath), value, flags, normalizeCallBack(onReady)); | ||
return this.client.a_create(this.fullPath(zkPath), value, flags, normalizeCallBack('create', zkPath, onReady)); | ||
}; | ||
@@ -68,3 +70,5 @@ | ||
msg: error, | ||
rc: resultCode | ||
rc: resultCode, | ||
action: 'exists', | ||
path: zkPath | ||
}, false); | ||
@@ -75,7 +79,7 @@ }); | ||
SimpleClient.prototype.get = function(zkPath, watch, onData) { | ||
return this.client.a_get(this.fullPath(zkPath), watch, normalizeCallBack(onData)); | ||
return this.client.a_get(this.fullPath(zkPath), watch, normalizeCallBack('get', zkPath, onData)); | ||
}; | ||
SimpleClient.prototype.getChildren = function(zkPath, watch, onData) { | ||
return this.client.a_get_children(this.fullPath(zkPath), watch, normalizeCallBack(onData)); | ||
return this.client.a_get_children(this.fullPath(zkPath), watch, normalizeCallBack('getChildren', zkPath, onData)); | ||
}; | ||
@@ -88,3 +92,5 @@ | ||
msg: err, | ||
rc: null | ||
rc: null, | ||
action: 'mkdir', | ||
path: zkPath | ||
}); | ||
@@ -97,3 +103,3 @@ } | ||
SimpleClient.prototype.set = function(zkPath, value, version, onReady) { | ||
return this.client.a_set(this.fullPath(zkPath), value, version, normalizeCallBack(onReady)); | ||
return this.client.a_set(this.fullPath(zkPath), value, version, normalizeCallBack('set', zkPath, onReady)); | ||
}; | ||
@@ -100,0 +106,0 @@ |
@@ -146,3 +146,5 @@ // This file has been generated from coffee source files | ||
msg: 'foo-error', | ||
rc: 99 | ||
rc: 99, | ||
path: '/foo', | ||
action: 'create' | ||
}); | ||
@@ -188,4 +190,6 @@ stub.calledOnce.should.equal(true); | ||
err.should.eql({ | ||
msg: 'foo-error', | ||
rc: 99, | ||
msg: 'foo-error' | ||
path: '/foo', | ||
action: 'exists' | ||
}); | ||
@@ -241,4 +245,6 @@ exists.should.equal(false); | ||
err.should.eql({ | ||
msg: 'foo-error', | ||
rc: 99, | ||
msg: 'foo-error' | ||
path: '/foo', | ||
action: 'get' | ||
}); | ||
@@ -283,4 +289,6 @@ stub.calledOnce.should.equal(true); | ||
err.should.eql({ | ||
msg: 'foo-error', | ||
rc: 99, | ||
msg: 'foo-error' | ||
path: '/foo', | ||
action: 'getChildren' | ||
}); | ||
@@ -324,4 +332,6 @@ stub.calledOnce.should.equal(true); | ||
err.should.eql({ | ||
msg: 'foo-error', | ||
rc: null, | ||
msg: 'foo-error' | ||
path: '/foo', | ||
action: 'mkdir' | ||
}); | ||
@@ -367,3 +377,5 @@ stub.calledOnce.should.equal(true); | ||
msg: 'foo-error', | ||
rc: 99 | ||
rc: 99, | ||
path: '/foo', | ||
action: 'set' | ||
}); | ||
@@ -370,0 +382,0 @@ stub.calledOnce.should.equal(true); |
{ | ||
"name": "zookeeper-hd", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Higher level (normalized) zookeeper client", | ||
@@ -5,0 +5,0 @@ "author": "Hans Donner", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
244672
2046