Sha256: 01625bce9dfc1671b6d956e83273de5906ec671dff8eb501dfe0cb921eb57206
Contents?: true
Size: 1.99 KB
Versions: 1
Compression:
Stored size: 1.99 KB
Contents
# Runs a Background Loop Forever [](http://www.rultor.com/p/yegor256/always) [](https://www.jetbrains.com/ruby/) [](https://github.com/yegor256/always/actions/workflows/rake.yml) [](http://www.0pdd.com/p?name=yegor256/always) [](http://badge.fury.io/rb/always) [](https://codecov.io/github/yegor256/always?branch=master) [](http://rubydoc.info/github/yegor256/always/master/frames) [](https://hitsofcode.com/view/github/yegor256/always) [](https://github.com/yegor256/always/blob/master/LICENSE.txt) This simple Ruby gem helps you run a loop forever, in a background thread. ```ruby 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: ```ruby # 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](https://www.yegor256.com/2014/04/15/github-guidelines.html). Make sure you build is green before you contribute your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 3.0+ and [Bundler](https://bundler.io/) installed. Then: ```bash bundle update bundle exec rake ``` If it's clean and you don't see any error messages, submit your pull request.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
always-0.0.5 | README.md |