Skip to content

jjb/better_timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Better Timeout

This is a fork of ruby 1.9.3 timeout which has the following behavior change:

Regardless of what errors the timed code catches, Timeout.timeout will always raise an exception if the code times out.

The stack traces might also be nicer, but this is still be full tested.

When the gem is installed, better_timeout takes over Timeout.timeout in all cases.

Installation

Add this line to your application's Gemfile:

gem 'better_timeout', git: 'https://github.com/jjb/better_timeout' # not in rubygems yet, need to install from git

And then execute:

$ bundle

Or install it yourself as:

$ gem install better_timeout

Discussion/findings

In standlib

  • same type of error is raised inside thread and outside when specified
  • when not specified, Exception is raised inside, StandardError is raised outside

this project was formerly named sane_timeout

About

Fixing Ruby's standard library Timeout

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages