All Projects → cristianbica → Activejob Perform_later

cristianbica / Activejob Perform_later

Licence: mit
Make any method perfomed later with ActiveJob

Programming Languages

ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Activejob Perform later

Auto Matching
Integrated Deai Engine(IDE: 統合出会い系エンジン)
Stars: ✭ 26 (+23.81%)
Mutual labels:  rails
Docker Rails
Dockerize Rails 6 with ActionCable, Webpacker, Stimulus, Elasticsearch, Sidekiq
Stars: ✭ 856 (+3976.19%)
Mutual labels:  rails
Ahoy email
First-party email analytics for Rails
Stars: ✭ 876 (+4071.43%)
Mutual labels:  rails
Adminpanel
This gem has the goal to act as the administration panel for your resources, so you can focus only on the public part of your app
Stars: ✭ 7 (-66.67%)
Mutual labels:  rails
Ui Bibz
Ui Frameworks based on Bootstrap and Ruby on Rails
Stars: ✭ 9 (-57.14%)
Mutual labels:  rails
Simple Navigation
A ruby gem for creating navigations (with multiple levels) for your Rails, Sinatra or Padrino applications. Render your navigation as html list, link list or breadcrumbs.
Stars: ✭ 868 (+4033.33%)
Mutual labels:  rails
Dotenv sekrets
Seamlessly encrypt/decrypt/edit your rails Dotenv files with the help of the Sekrets gem
Stars: ✭ 25 (+19.05%)
Mutual labels:  rails
Hold please
📞 Disable ActiveRecord callbacks in Rails for great justice!
Stars: ✭ 20 (-4.76%)
Mutual labels:  rails
Heavens door
Capybara test scenario recorder for Rails
Stars: ✭ 857 (+3980.95%)
Mutual labels:  rails
Livingstyleguide
Easily create front-end style guides with Markdown and Sass/SCSS.
Stars: ✭ 874 (+4061.9%)
Mutual labels:  rails
Ridgepole
Ridgepole is a tool to manage DB schema. It defines DB schema using Rails DSL, and updates DB schema according to DSL. (like Chef/Puppet)
Stars: ✭ 840 (+3900%)
Mutual labels:  rails
Invisible captcha
🍯 Unobtrusive and flexible spam protection for Rails apps
Stars: ✭ 851 (+3952.38%)
Mutual labels:  rails
Vue Rails Form Builder Demo
An example of Rails app using vue-form-for gem
Stars: ✭ 12 (-42.86%)
Mutual labels:  rails
Human attribute values
Translation of attribute values in rails
Stars: ✭ 7 (-66.67%)
Mutual labels:  rails
Devise Jwt
JWT token authentication with devise and rails
Stars: ✭ 881 (+4095.24%)
Mutual labels:  rails
Rails Erd D3
Ruby gem for creating entity–relationship diagram with D3.js for your Rails application 📊
Stars: ✭ 25 (+19.05%)
Mutual labels:  rails
Active record doctor
Identify database issues before they hit production.
Stars: ✭ 865 (+4019.05%)
Mutual labels:  rails
Activerecord Sqlserver Adapter
SQL Server Adapter For Rails
Stars: ✭ 910 (+4233.33%)
Mutual labels:  rails
Pres
A Simple Rails Presenter
Stars: ✭ 15 (-28.57%)
Mutual labels:  rails
Ruby Rails Mysql Template
This example shows how to use Anychart library with the Ruby on Rails and MySQL database.
Stars: ✭ 12 (-42.86%)
Mutual labels:  rails

Build Status

Activejob::PerformLater

Make any method perfomed later.

Installation

Add this line to your application's Gemfile:

gem 'activejob-perform_later'

And then execute:

$ bundle

Or install it yourself as:

$ gem install activejob-perform_later

Usage

Declare your class methods as always performed later

class MyClass
  def self.a_method(arg1, arg2)
    # do stuff
  end
  perform_later :a_method
  perform_later :a_method, queue: :low_priority
  perform_later :a_method, wait: 10.minutes
  perform_later :a_method, wait: 60.minutes, queue: :low_priority
end

#calling the method will actually schedule the method to be performed later by ActiveJob
MyClass.a_method(1, 2)

Perform your class method delayed whenever you need that

class MyClass
  def self.a_method(arg1, arg2)
    # do stuff
  end
end

# calling the method directly will perform it inline
MyClass.a_method(1,2)

# calling the method with perform_later will schedule the performing in Active Job
MyClass.perform_later.a_method(1,2)
MyClass.perform_later(queue: :low_priority).a_method(1,2)
MyClass.perform_later(wait: 10.minutes).a_method(1,2)
MyClass.perform_later(wait: 10.minutes, queue: :low_priority).a_method(1,2)
MyClass.perform_later(wait_until: 60.minutes.from_now, queue: :low_priority).a_method(1,2)
end

Perform your instance method delayed

This works only if your class is safe to be passed to Active Job (e.g.: it's global identificable with GlobalID. Active Record implements GlobalID since 4.2.0):

class User < ActiveRecord::Base
  def recalculate_billing
    # do stuff
  end
end

# calling the method with perform_later will schedule the performing in Active Job
User.last.perform_later.recalculate_billing
User.last.perform_later(queue: :low_priority).recalculate_billing
User.last.perform_later(wait: 10.minutes).recalculate_billing
User.last.perform_later(wait_until: 60.minutes.from_now).recalculate_billing
User.last.perform_later(wait: 10.minutes, queue: :low_priority).recalculate_billing
User.last.perform_later(wait_until: 60.minutes.from_now, queue: :low_priority).recalculate_billing
end

Contributing

  1. Fork it ( https://github.com/cristianbica/activejob-perform_later/fork )
  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 a new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].