Project

delayer

0.0
Low commit activity in last 3 years
No release in over a year
Delay the processing
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 12.3.2
>= 3.3.3, < 4.0
 Project Readme

Delayer

toshia

Delay Any task. Similar priority-queue.

Installation

Add this line to your application's Gemfile:

gem 'delayer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install delayer

Usage

Task = Delayer.generate_class # Define basic class
Task = Delayer.generate_class(priority: [:high, :middle, :low], default: :middle) # or, Priority delayer
Task = Delayer.generate_class(expire: 0.5) # and/or, Time limited delayer.

task = Task.new { delayed code ... } # Register task
task = Task.new(:high) { delayed code ... } # or, You can specify priority.

task.cancel # Task can cancel before Delayer#run.

Task.run # Execute all tasks.
Task.run(1) # or, You can specify expire.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request