Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/node.js b/src/node.js
index 914f02f..76b41be 100644
--- a/src/node.js
+++ b/src/node.js
@@ -192,14 +192,16 @@ process.openStdin = function () {
// console object
function format (f) {
+ var sys = module.requireNative('sys');
var i = 1;
diff --git a/src/node.js b/src/node.js
index 914f02f..98c9ade 100644
--- a/src/node.js
+++ b/src/node.js
@@ -192,18 +192,27 @@ process.openStdin = function () {
// console object
function format (f) {
- var i = 1;
- var args = arguments;
// console object
function format (f) {
var sys = module.requireNative('sys');
var args = new Array(arguments.length);
for(var i = 0, len = arguments.length, a; i<len; i++) {
a = arguments[i];
sys.puts([i, len, a].join(' '));
switch (typeof a) {
case 'string':
var sys = require('sys')
, http = require("http");
var client = http.createClient('80', 'www.google.com');
var request, ctr=0, delay=100;
setTimeout(function() {
console.error('INT:\n%j', process.ioThreadUsage());
if(ctr<20) setTimeout(arguments.callee, 10);
// Add some ruby-like methods to some of the builtins
Object.prototype.instance_eval = function (block) {
// Convert the function to a string so that we can rebind it
if (typeof block === 'function') {
block = "(" + block + ").call(this)";
}
// Eval using "this" as the "with" scope
return eval("with(this) { " + block + "}");
};
include("/utils.js");
// "this" scope is the object, closures work like normal. Basically this is a nowmal "call" use for functions
Object.prototype.instance_eval = function (input) {
// Convert the function to a string so that we can rebind it
if (typeof input === 'function') {
return input.call(this);
}
var http = require("http");
http.cat('http://www.google.com/', 'utf8', function(err, data) {
console.log(err);
console.log(data);
});
commit 4d22609d665f937985dbd0ac1b8a7f1c8c62a237
Date: Sun Aug 8 12:49:58 2010 -0400
Add process.maxIOThreads to allow managing io threads at runtime.
diff --git a/src/node.cc b/src/node.cc
index b13f7ce..ee20707 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -267,6 +267,28 @@ static void EIODonePoll(void) {
commit 34488642c115366db65c2680ccc3c4d4138132b0
Date: Fri Jul 23 19:51:04 2010 -0400
first around at surfacing thread usage data. broken :(
diff --git a/deps/libeio/eio.c b/deps/libeio/eio.c
index 6f61f5d..1c23b0d 100644
--- a/deps/libeio/eio.c
+++ b/deps/libeio/eio.c
@@ -212,7 +212,7 @@ static int tvdiff (struct timeval *tv1, struct timeval *tv2)
Object.getAllPropertyNames = function(obj) {
var keys = [];
while(obj && obj !== Object) {
keys = keys.concat(Object.getOwnPropertyNames(obj));
obj = Object.getPrototypeOf(obj);
}
return keys;
}