Re: limiting how long a method is permiited to run



>>>>> "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


.



Relevant Pages

  • Re: does ExecutionTimeout include file upload time?
    ... - the timeout is taken from the IIS application configuration ... only valid for the duration of the current request. ... I would like to allow the user to upload large files if required, ... Is there any way to set the execution timeout differently on different ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: does ExecutionTimeout include file upload time?
    ... - the timeout is taken from the IIS application configuration ... only valid for the duration of the current request. ... I would like to allow the user to upload large files if required, ... Is there any way to set the execution timeout differently on different ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: TimeOut - ThreadAbortException
    ... Execution Timeout ... > What is most likely happening here is that on your server, ... > your execution timeout at the server is being triggrered, ... > able to receive the request fine, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • RE: Unable to timeout a long running request
    ... Well Execution Timeout is workin now. ... Timeout values are specified in milliseconds. ... this will work only when the debugging is set to false. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Execution Timeout Problem
    ... Hi Mark, ... In addition to Brock's suggestion on make your serverside processing ... you can also check whether you've apply any Timeout setting at ... you need to access the server somehow to initiate the long ...
    (microsoft.public.dotnet.framework.aspnet)