Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0f942ca
Showing
10 changed files
with
1,270 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/TAGS | ||
/pkg | ||
/doc | ||
*.swp |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
=== 1.0.0 / 2010-09-16 | ||
|
||
* Major Enhancements | ||
* Based on drbrain/net-http-persistent but uses a connection pool instead of connection/thread |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2010 Eric Hodel, Aaron Patterson | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
'Software'), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
= persistent_http | ||
|
||
* http://github.com/bpardee/persistent_http | ||
|
||
== DESCRIPTION: | ||
|
||
Persistent connections using Net::HTTP with a connection pool. | ||
|
||
This is based on Eric Holder's Net::HTTP::Persistent libary but uses | ||
a connection pool of Net::HTTP objects instead of a connection per | ||
thread. C/T is fine if you're only using your http threads to make | ||
connections but if you use them in child threads then I suspect you | ||
will have a thread memory leak. Also, you will generally get less | ||
connection resets if the most recently used connection is always | ||
returned. | ||
|
||
== FEATURES/PROBLEMS: | ||
|
||
* Supports SSL | ||
* Thread-safe | ||
* Pure ruby | ||
* Timeout-less speed boost for 1.8 (by Aaron Patterson) | ||
|
||
== INSTALL: | ||
|
||
gem install persistent_http | ||
|
||
== EXAMPLE USAGE: | ||
|
||
require 'persistent_http' | ||
|
||
class MyHTTPClient | ||
@@persistent_http = PersistentHTTP.new( | ||
:name => 'MyHTTPClient', | ||
:logger => Rails.logger, | ||
:pool_size => 10, | ||
:warn_timeout => 0.25, | ||
:force_retry => true, | ||
:url => 'https://www.example.com/echo/foo' # equivalent to :use_ssl => true, :host => 'www.example.com', :default_path => '/echo/foo' | ||
) | ||
|
||
def send_get_message | ||
response = @@persistent_http.request | ||
... Handle response as you would a normal Net::HTTPResponse ... | ||
end | ||
|
||
def send_post_message | ||
request = Net::HTTP::Post.new('/perform_service) | ||
... Modify request as needed ... | ||
response = @@persistent_http.request(request) | ||
... Handle response as you would a normal Net::HTTPResponse ... | ||
end | ||
end | ||
|
||
|
||
== Copyright | ||
|
||
Copyright (c) 2010 Eric Hodel, Aaron Patterson, Brad Pardee. See LICENSE for details. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'rubygems' | ||
require 'rake' | ||
|
||
begin | ||
require 'jeweler' | ||
Jeweler::Tasks.new do |gemspec| | ||
gemspec.name = "persistent_http" | ||
gemspec.summary = "Persistent HTTP connections using a connection pool" | ||
gemspec.description = "Persistent HTTP connections using a connection pool" | ||
gemspec.email = "bradpardee@gmail.com" | ||
gemspec.homepage = "http://github.com/bpardee/persistent_http" | ||
gemspec.authors = ["Brad Pardee"] | ||
end | ||
rescue LoadError | ||
puts "Jeweler not available. Install it with: gem install jeweler" | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.0 |
Oops, something went wrong.