0.0
No commit activity in last 3 years
No release in over 3 years
Persistent pool of HTTP connections
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.1.2
~> 1.1.3
~> 0.1.2

Runtime

 Project Readme

Net::HTTP::Pool

Build Status

Pool

Act like a database pool but for HTTP.

It will attempt to open (default: 5) persistent connections to a given server. Then you can make your requests as you want and the pool get recycled. The implementation it's made throght actors (celluloid) so the behaviour in the verb block it's async.

The target of the lib it's to provide DB-like pool to handle information exchange.

Motivation

The main goal it's to provide a easy to use HTTP pool exploiting HTTP 1.1 persistent connections in a non-blocking way.

Example

require 'net/http/pool'

pool = Net::HTTP::Pool.new("http://elcuervo.co")
request = Net::HTTP::Get.new("/humans.txt")

pool.request(request) do |response|
  File.open('nevermore.txt', 'w') { |f| f << response.body } if response.code == "200"
end

Thanks to