Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #17 from twistdigital/424c3e0cbc10084065d586564f69…
Browse files Browse the repository at this point in the history
…74e611ed05fb

The "sys" module is now called "util".
  • Loading branch information
elbart committed Jan 29, 2012
2 parents 5fa60c0 + 424c3e0 commit 53824ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var sys = require('sys');
var util = require('util');
var memcache = require('./lib/memcache');

function microtime(get_as_float) {
Expand All @@ -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();
});
};
Expand All @@ -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));
}
});
}
Expand All @@ -35,29 +35,29 @@ 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();
});
});
};

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();
});
};
Expand Down
10 changes: 5 additions & 5 deletions lib/memcache.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

var tcp = require('net'),
sys = require('sys');
util = require('util');

var crlf = "\r\n";
var crlf_len = crlf.length;
Expand All @@ -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) {
Expand All @@ -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();
});
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
};

Expand Down
4 changes: 2 additions & 2 deletions test/test-memcache.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tests for expresso
*/

var sys = require('sys'),
var util = require('util'),
memcache = require('memcache'),
assert = require('assert'),
port = 11211;
Expand All @@ -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();
Expand Down

0 comments on commit 53824ca

Please sign in to comment.