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

always

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

always

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Runs a Background Loop Forever

DevOps By Rultor.com We recommend RubyMine

rake PDD status Gem Version Test Coverage Yard Docs Hits-of-Code License

This simple Ruby gem helps you run a loop forever, in a background thread.

require 'always'
# Prepare, with five threads:
a = Always.new(5)
# Start them all together spinning forever with 30-seconds delay between cycles:
a.start do
  puts "I'm alive"
end
# Stop them all together:
a.stop

You may be interested to get the backtraces of the exceptions that happened most recently:

# Keep the last 10 error backtraces in memory:
a = Always.new(5, max_backtraces: 10)
# Retrieve them:
p a.backtraces

That's it.

How to contribute

Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 3.0+ and Bundler installed. Then:

bundle update
bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.

FAQs

Package last updated on 04 Jul 2024

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