Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
README.md
main.js
package.json

README.md

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');
    });        
  });
Something went wrong with that request. Please try again.