Name Last Update
..
._main.js Loading commit data...
._package.json Loading commit data...
README.md Loading commit data...
main.js Loading commit data...
package.json Loading commit data...

Pool -- Simple HTTP client pooling

Install

  npm install pool

Super simple to use

Pool has two core usage scenarios: creating a pool and creating a set of pools. Creating a pool is easy:

  var pool = require('pool'),
      sys = require('sys'),
      local = pool.createPool('80', 'localhost');

  client = local.request('GET', '/', function (request) {
    // You can work with the request here just as you would as if it 
    // was returned from http.createClient
    request.on('end', function () {
      sys.puts('Request ended');
    });
  });

Creating a set of pools can be accomplished using a PoolManager:

  var pool = require('pool'),
      manager = pool.createPoolManager(),
      local = manager.getPool('80', 'localhost');

  client = local.request('GET', '/', function (request) {
    // You can work with the request here just as you would as if it 
    // was returned from http.createClient
    request.on('end', function () {
      sys.puts('Request ended');
    });        
  });