| Path: | lib/timeout.rb |
| Last Update: | Thu Dec 15 09:57:05 CST 2005 |
A way of performing a potentially long-running operation in a thread, and terminating it’s execution if it hasn’t finished within fixed amount of time.
Previous versions of timeout didn’t use a module for namespace. This version provides both Timeout.timeout, and a backwards-compatible timeout.
require 'timeout'
status = Timeout::timeout(5) {
# Something that should be interrupted if it takes too much time...
}
| TimeoutError | = | Timeout::Error # :nodoc: | Another name for Timeout::Error, defined for backwards compatibility with earlier versions of timeout.rb. |