This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flushAndShutdown(exitCode) { | |
if(process.stdout.flush()) { | |
process.exit(exitCode); | |
} | |
else { | |
process.stdout.on('drain', function() { | |
process.exit(exitCode); | |
}) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var util = require('util'); | |
var count = (new Date()).getTime(); | |
var apiPath = 'services/rest/?method=flickr.photos.getInfo&api_key=52102ae42eabc584b4f587b5f7aa5797&photo_id=6053145786+-+013&format=rest'; | |
var agent = http.getAgent('api.flickr.com', 80); | |
agent.maxSockets = 10; | |
console.log(util.inspect(agent)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var util = require('util'); | |
var count = (new Date()).getTime(); | |
var apiPath = 'services/rest/?method=flickr.photos.getInfo&api_key=52102ae42eabc584b4f587b5f7aa5797&photo_id=6053145786+-+013&format=rest'; | |
var host = 'api.flickr.com'; | |
var numberOfRequests = 1000; | |
var completedCount = 0; | |
var startTime = (new Date()).getTime(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ar http = require('http'); | |
var util = require('util'); | |
var count = (new Date()).getTime(); | |
var apiPath = 'services/rest/?method=flickr.photos.getInfo&api_key=52102ae42eabc584b4f587b5f7aa5797&photo_id=6053145786+-+013&format=rest'; | |
var host = 'api.flickr.com'; | |
var agent = http.getAgent(host, 80); | |
agent.maxSockets = 50; | |
console.log(util.inspect(agent)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:33:in `select': closed stream (IOError) | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:33:in `io_select' | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:32:in `synchronize' | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:32:in `io_select' | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/packet_stream.rb:73:in `available_for_read?' | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/packet_stream.rb:85:in `next_packet' | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/session.rb:169:in `poll_message' | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/session.rb:164:in `loop' | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/transport/session.rb:164:in `poll_message' | |
from /Library/Ruby/Gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:451:in `dispatch_incoming_pac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// common.js ====================================== | |
(function(exports) { | |
// Define all your functions on the exports object | |
exports.foo = function() { | |
return 'bar'; | |
}; | |
})((typeof process === 'undefined' || !process.versions) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// common.js ====================================== | |
exports.foo = function() { | |
return 'bar'; | |
} | |
// ================================================ | |
// anotherfile.js ================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window) { | |
var common = window.common = {}; | |
common.foo = function() { | |
return 'bar'; | |
}; | |
})(window); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
function makeRequests() { | |
for(var i=0; i<100; ++i) { | |
http.request({ | |
host: '127.0.0.1', | |
port: 8080, | |
method: 'GET' | |
}, function(res) { | |
// do something with the response |
OlderNewer