Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

safe_timeout

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safe_timeout

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SafeTimeout

  • README: https://github.com/david-mccullars/safe_timeout
  • Documentation: http://www.rubydoc.info/github/david-mccullars/safe_timeout
  • Bug Reports: https://github.com/david-mccullars/safe_timeout/issues

Status

Gem Version Build Status Code Climate Test Coverage MIT License

Description

A safer alternative to Ruby's Timeout that uses unix processes instead of threads

Installation

Add this line to your application's Gemfile:

gem 'safe_timeout'

And then execute:

$ bundle

Or install it yourself as:

$ gem install safe_timeout

Usage

SafeTimeout is a drop-in replacement for Ruby's Timeout.

SafeTimeout.timeout(2) do
  # Something that may take a while
  # Possible Timeout::Error raised
end

or

SafeTimeout.timeout(10, CustomTimeoutError) do
  # Something that may take a while
  # Possible CustomTimeoutError raised
end

If one wishes this to be even more of a drop-in replacement one could add the following to the top of an application:

Timeout = SafeTimeout

License

MIT. See the {file:LICENSE} file.

FAQs

Package last updated on 04 Jan 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc