Path: | timeout.rb |
Last Update: | Sat Oct 15 23:44:28 AUS Eastern Standard Time 2005 |
execution timeout
require 'timeout' status = Timeout::timeout(5) { # Something that should be interrupted if it takes too much time... }
A way of performing a potentially long-running operation in a thread, and terminating it’s execution if it hasn’t finished by a fixed amount of time.
Previous versions of timeout didn’t provide use a module for namespace. This version provides both Timeout.timeout, and a backwards-compatible timeout.
Copyright: | (C) 2000 Network Applied Communication Laboratory, Inc. |
Copyright: | (C) 2000 Information-technology Promotion Agency, Japan |
TimeoutError | = | Timeout::Error | Another name for Timeout::Error, defined for backwards compatibility with earlier versions of timeout.rb. |
Identical to:
Timeout::timeout(n, e, &block).
Defined for backwards compatibility with earlier versions of timeout.rb, see Timeout#timeout.
# File timeout.rb, line 61 def timeout(n, e=Timeout::Error, &block) Timeout::timeout(n, e, &block) end