Topic: Timing out a call?

I'm wondering if it's possible to have rails do an action unless it takes too long otherwise skip it.  For example, I'm using a free service to try to determine a user's location based on IP address, but sometimes (too frequently) that service is down and my entire web page doesn't load because of it.  What I'd like to do is have it try for 2 seconds and if it doesn't get a response skip trying and just assign a value.  Possible?

Re: Timing out a call?

at a guess you could put it into a loop based on less than + 2 seconds or value being set.

that might not be the right answer but I'm sure its possible