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

Could you add default timeout? #17

Closed
xiaoronglv opened this issue Feb 2, 2015 · 3 comments
Closed

Could you add default timeout? #17

xiaoronglv opened this issue Feb 2, 2015 · 3 comments
Assignees

Comments

@xiaoronglv
Copy link

Hi @stevenosloan ,

slack-notifier is a wonderful gem. I use it to send notification in exception_notification (a rails / sidekiq error monitor).

Sending message is a slow IO operation which will block our App. Sometime it will frozen sidekiq worker.

https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting#frozen-workers

Could you add default timeout to avoid frozen sidekiq/rails thread?

@stevenosloan
Copy link
Member

Yeah, that'd be a great inclusion to the DefaultHTTPClient. I'll take a look when I get a little more time later this week.

In the mean time, you could roll your own injecting your own HTTP client if needed, or PR's are more than welcome.

cheers,
steven

@stevenosloan
Copy link
Member

Hey @xiaoronglv, I just pushed out version 1.1.0 that includes the option to set http options like open_timeout. You can set that at either initialization for when you call ping.

# on initialization
notifier = Slack::Notifier.new "WEBHOOK_URL", username: "foo", http_options: { open_timeout: 10 }

# or ping
notifier.ping "hello", http_options: { open_timeout: 10 }

@xiaoronglv
Copy link
Author

Thanks.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants