-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make keep_alive_timeout configurable #405
Conversation
This CI failure is unrelated to the changes. |
@@ -138,8 +140,11 @@ def timeout(klass, options = {}) # rubocop:disable Style/OptionHash | |||
# | |||
# @yieldparam [HTTP::Client] client Persistent client | |||
# @return [Object] result of last expression in the block | |||
def persistent(host) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We officially support ruby 2.0+, so it's better to use kwargs in here:
def persistent(host, timeout: nil)
# ...
spec/lib/http_spec.rb
Outdated
context "with timeout specified" do | ||
subject { HTTP.persistent host, :timeout => 100 } | ||
it "sets keep_alive_timeout" do | ||
options = subject.default_options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use named subject please:
subject(:client) { HTTP.persistent ... }
# ...
options = client.default_options
@@ -1,3 +1,4 @@ | |||
# coding: utf-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this duplicates line 3
Allow keep_alive_timeout to be set in persistent: HTTP.persistent("http...", timeout: 120)
2056ab7
to
8bb2a6c
Compare
This has been updated. |
Merged as 4738d22 |
## 2.2.2 (2017-04-27) * [#404](httprb/http#404), [#405](httprb/http#405) Make keepalive timeout configurable. ([@nestegg])
Allow keep_alive_timeout to be set in persistent:
HTTP.persistent("http...", timeout: 120)