Net::HTTP.get_response timeout - ruby

Does Net::HTTP.get_response timeout after some number of seconds?
If it does not, is there a way for me to add a timeout?

There doesn't seem to be any method nor attributes for either Net:HTTP.get_response and/or Net:HTTP.get_print as per latest documentation. There is a nice blog post that documents the basics for setting the timeouts though.

Related

Does okhttp enforce any sort of limit on the size of a request body?

I've looked through the okhttp documentation looking for an answer to this question, but have come up empty so far. Does the okhttp library have an enforceable limit on the size of a request body? I'm using version 4.9.1 in case that matters.
Thanks in advance
There's no limit. Practically speaking you'll want to choose a size that can be transmitted in a minute or less, otherwise timeouts get difficult and you'll waste work if things fail and need to be restarted.

ElasticSearch, Nest and timeout for long queries

I am using ElasticSearch with Nest (0.9.16) and have some queries which take longer than 60 seconds. When that happens, I receive the following error:
The request was aborted: The request was canceled.
While I am concerned that the query is taking such a long time, for this question, I am just interested if there is a way to increase the timeout. I have not been able to find a way to increase the timeout.
Note, I do see a couple of places where I can set a timeout, but these are not the right places:
var setting = new ConnectionSettings(new Uri(searchUrl)).SetTimeout(200000);
or
searchdescriptor.Timeout("120000");
The first one sets the connection timeout and the second one sets the ElasticSearch timeout, both of which are not helpful here.
Thanks,
Eric
Actually, much to my chagrin, the ConnectionSettings().SetTimeout() does in fact increase the request timeout and solve my problem. I am not sure why I missed this initially.

What is the difference between timeout and open timeout?

In the Ruby RestClient gem, what's the difference between the timeout and open-timeout functionality?
http://www.ruby-doc.org/gems/docs/w/wgibbs-rest-client-1.0.5/RestClient/Resource.html#method-i-open_timeout
I didn't get anything from the doc file of the gem either.
You're reading the wrong documentation (yours is for wgibbs-rest-client which has not been updated since 2009): here's the right one. But that one does not say anything about the difference either, although it is simple:
:open_timeout is the timeout for opening the connection. This is useful if you are calling servers with slow or shaky response times.
:timeout is the timeout for reading the answer. This is useful to make sure you will not get stuck half way in the reading process, or get stuck reading a 5 MB file when you're expecting 5 KB of JSON.

making client side notifications of a timeout in rails using devise timeout_in and timeoutable

Is there any way rails devise can warn a user before the timeout happens, or just timeout on its own (without doing a post) once the timeout_in time is met? I suspect it needs some sort of jquery on the client side, but I'm not sure how to implement this to make this play nice with devise#timeout_in. Googling around, I didn't find much - is there a specific technical term I should be Googling to find more helpful information?
I have the same question myself. The only thing I can suggest (far from ideal) is putting in a javascript countdown equal to the timeoutable value (like 10 minutes or whatever) MINUS the warning threshold.
This countdown will get reset anytime ANY input happens from the user. So if you set it to 9 minutes and timeoutable is 10, you show a warning accordingly.
maybe you can use this gem
https://github.com/pelargir/auto-session-timeout
fork it and have it return with the active ajax call the time left for the session

How to configure the update interval for Yahoo! Pipes?

I am creating some RSS using Yahoo! Pipes, but the update interval is too long. How can i change it? If it is not possible to change, how long it is exactly?
The Pipes docs says it honors the standard HTTP expiration headers, so it depends on your sources' headers.
However, there is also a minimum interval, this post claims it's around 10 minutes.

Resources