Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed sys to util for node 0.6

  • Loading branch information...
commit 424c3e0cbc10084065d586564f6974e611ed05fb 1 parent 5fa60c0
Howard Yeend authored
Showing with 14 additions and 14 deletions.
  1. +7 −7 example.js
  2. +5 −5 lib/memcache.js
  3. +2 −2 test/test-memcache.js
View
14 example.js
@@ -1,4 +1,4 @@
-var sys = require('sys');
+var util = require('util');
var memcache = require('./lib/memcache');
function microtime(get_as_float) {
@@ -9,7 +9,7 @@ function microtime(get_as_float) {
var onConnect = function() {
mcClient.get('test', function(err, data) {
- sys.debug(data);
+ util.debug(data);
mcClient.close();
});
};
@@ -24,7 +24,7 @@ var benchmark = function() {
x += 1;
if (x == count) {
end = microtime(true);
- sys.debug('total time: ' + (end - start));
+ util.debug('total time: ' + (end - start));
}
});
}
@@ -35,7 +35,7 @@ var benchmark = function() {
var setKey = function() {
mcClient.set('test', 'hello \r\n node-memcache', function(err, response) {
mcClient.get('test', function(err, data) {
- sys.debug(data);
+ util.debug(data);
mcClient.close();
});
});
@@ -43,21 +43,21 @@ var setKey = function() {
var version = function() {
mcClient.version(function(err, version) {
- sys.debug(version);
+ util.debug(version);
mcClient.close();
});
};
var incr = function() {
mcClient.increment('x', 2, function(err, new_value) {
- sys.debug(new_value);
+ util.debug(new_value);
mcClient.close();
});
};
var decr = function() {
mcClient.decrement('x', 1, function(err, new_value) {
- sys.debug(new_value);
+ util.debug(new_value);
mcClient.close();
});
};
View
10 lib/memcache.js
@@ -24,7 +24,7 @@
*/
var tcp = require('net'),
- sys = require('sys');
+ util = require('util');
var crlf = "\r\n";
var crlf_len = crlf.length;
@@ -42,7 +42,7 @@ var Client = exports.Client = function(port, host) {
this.handles = [];
};
-sys.inherits(Client, process.EventEmitter);
+util.inherits(Client, process.EventEmitter);
Client.prototype.connect = function () {
if (!this.conn) {
@@ -57,7 +57,7 @@ Client.prototype.connect = function () {
this.conn.addListener("data", function (data) {
self.buffer += data;
- // sys.debug(data);
+ // util.debug(data);
self.recieves += 1;
self.handle_received_data();
});
@@ -97,7 +97,7 @@ Client.prototype.addHandler = function(callback) {
Client.prototype.dispatchHandles = function() {
for (var i in this.handles) {
var handle = this.handles.shift();
- // sys.debug('dispatching handle ' + handle);
+ // util.debug('dispatching handle ' + handle);
if (typeof handle !== 'undefined') {
handle();
}
@@ -162,7 +162,7 @@ Client.prototype.cas = function(key, value, unique, callback, lifetime, flags) {
Client.prototype.del = function(key, callback){
- sys.error("mc.del() is deprecated - use mc.delete() instead");
+ util.error("mc.del() is deprecated - use mc.delete() instead");
return this.delete(key, callback);
};
View
4 test/test-memcache.js
@@ -2,7 +2,7 @@
tests for expresso
*/
-var sys = require('sys'),
+var util = require('util'),
memcache = require('memcache'),
assert = require('assert'),
port = 11211;
@@ -19,7 +19,7 @@ mc.on('error', function(e){
}
exports['startup test'] = function(){
- assert.ok(false, "Unexpected error during connection: "+sys.inspect(e));
+ assert.ok(false, "Unexpected error during connection: "+util.inspect(e));
}
});
mc.connect();
Please sign in to comment.
Something went wrong with that request. Please try again.