Skip to content
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

Add ability to configure default settings for new connections #177

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

fatkodima
Copy link
Contributor

Closes #176.

It should be used by something like this:

Net::HTTP.default_configuration = {
  read_timeout: 1,
  write_timeout: 1
}

http = Net::HTTP.new(hostname)
http.open_timeout   # => 60
http.read_timeout   # => 1
http.write_timeout  # => 1

Probably, there is a better name for the new option. And maybe we should allow more options to be configured, let me know.

@hsbt hsbt merged commit bd8f570 into ruby:master Jul 11, 2024
@hsbt
Copy link
Member

hsbt commented Jul 11, 2024

Thanks!

@fatkodima fatkodima deleted the ability-to-set-defaults branch July 11, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

idea: global timeout settings
2 participants