
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
[![Coverage Status] (https://coveralls.io/repos/ledestin/frugal_timeout/badge.png)] (https://coveralls.io/r/ledestin/frugal_timeout)
Ruby Timeout.timeout replacement using only 1 thread
As you may know, the stock Timeout.timeout uses thread per timeout call. If you use it a lot, you will soon be out of threads. This gem is to provide an alternative that uses only 1 thread.
Also, there's a race condition in the 1.9-2.0 stock timeout. Consider the following code:
timeout(0.02) {
timeout(0.01, IOError) { sleep }
}
In this case, the stock timeout will most likely raise IOError, but, given the race condition, sometimes it can also raise Timeout::Error. Just put `sleep 0.1' inside stock timeout ensure to trigger that. As of version 0.0.9, frugal_timeout will always raise IOError.
require 'frugal_timeout'
begin
FrugalTimeout.timeout(0.1) { sleep }
rescue Timeout::Error
puts 'it works!'
end
# Ensure that calling timeout() will use FrugalTimeout.timeout().
FrugalTimeout.dropin!
# Rescue frugal-specific exception if needed.
begin
timeout(0.1) { sleep }
rescue FrugalTimeout::Error
puts 'yay!'
end
Tested on Ruby 1.9.3 and 2.0.0.
gem install frugal_timeout
FAQs
Unknown package
We found that frugal_timeout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.