Skip to content

Instantly share code, notes, and snippets.

var rpc = module.exports = function() {
events.EventEmitter.call(this);
var self = this;
this.counter = 0;
this.functions = {};
this.promises = {};
this.id
this.slaves = {}
Downloader.prototype.download = function() {
if(this.quota.length >= 1 && !this.isDownloading) {
this.isDownloading = true;
var id = this.quota.shift();
var httpClient = http.createClient(this.port, this.host);
var request = httpClient.request('GET', '/download/' + this.key + '/' + id, {
events.js:45
throw arguments[1]; // Unhandled 'error' event
^
Error: error parsing url
at Parser.execute (/home/joe/Devel/node_modules/bouncy/node_modules/parsley/index.js:24:27)
at Socket.<anonymous> (/home/joe/Devel/node_modules/bouncy/node_modules/parsley/index.js:11:14)
at Socket.emit (events.js:64:17)
at Socket._onReadable (net.js:672:14)
at IOWatcher.onReadable [as callback] (net.js:177:10)
var bouncy = require('bouncy');
module.exports = function(evn) {
bouncy(function(req, bounce) {
try {
if(evn.domains.hasOwnProperty(req.headers.host)) {
bounce(evn.domains[req.headers.host].port);
} else if(evn.cdn.hosts.hasOwnProperty(req.headers.host)) {
bounce(evn.cdn.hosts[req.headers.host].port);
var utils = require('../lib/util')
var RpcModule = require('../lib/rpc').RpcModule
var events = require('events');
var util = require('util');
var net = require('net');
/***
*
*
var utils = require('./util')
var RpcModule = require('./rpc').RpcModule
var events = require('events');
var util = require('util');
var net = require('net');
var crypto = require('crypto');
/***
/***
* Node modules
*/
var events = require('events');
var util = require('util');
var fs = require('fs');
/***
* Local modules
*/
var argsKeys = [];
var argsObjs = [];
for(var i = 0; i < locals.length; i++) {
argsKeys.push(locals[i].key);
argsObjs.push(locals[i].object);
};
argsKeys.push('return (' + block + ')(' + argsKeys.join(',') + ');');
@FLYBYME
FLYBYME / gist:1659615
Created January 23, 2012 00:29
fs-pool
var fs = require('fs')
var events = require('events')
var util = require('util')
var path = require('path')
var FsPool = module.exports = function(dir) {
events.EventEmitter.call(this)
this.dir = dir;
this.files = [];
this.active = [];
/***
*
*
*
*/
var vm = require('vm');
var events = require('events');
var util = require('util');
var fs = require('fs');
var npm = require('npm');