Re: limiting how long a method is permiited to run
- From: ts <decoux@xxxxxxxxxxxxxx>
- Date: Tue, 6 Dec 2005 02:02:23 +0900
>>>>> "B" == Brian Buckley <briankbuckley@xxxxxxxxx> writes:
B> Is there a means of limiting how long a method is permiited to run? I
B> want to be able to mark a method with a number and have the method
B> throw, say, a TooMuchTimeException if the running time exceeds this
B> number.
Well, you have timeout.rb in the standard distribution
# = timeout.rb
#
# execution timeout
#
# = Synopsis
#
# require 'timeout'
# status = Timeout::timeout(5) {
# # Something that should be interrupted if it takes too much time...
# }
#
# = Description
#
# 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.
#
Guy Decoux
.
- Follow-Ups:
- Re: limiting how long a method is permiited to run
- From: Gary Watson
- Re: limiting how long a method is permiited to run
- References:
- limiting how long a method is permiited to run
- From: Brian Buckley
- limiting how long a method is permiited to run
- Prev by Date: Re: limiting how long a method is permiited to run
- Next by Date: Re: What a response!
- Previous by thread: Re: limiting how long a method is permiited to run
- Next by thread: Re: limiting how long a method is permiited to run
- Index(es):
Relevant Pages
|
|