0.03
No release in over 3 years
Low commit activity in last 3 years
activejob-cancel provides cancel method to Active Job
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

ActiveJob::Cancel

activejob-cancel provides cancel method to Active Job. Currently it supports only Sidekiq, Delayed Job, resque and the Active Job TestAdapter.

Build Status Gem Version Code Climate Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'activejob-cancel'

And then execute:

$ bundle

Or install it yourself as:

$ gem install activejob-cancel

Usage

# app/jobs/hello_job.rb
class HelloJob < ActiveJob::Base
  def perform
  end
end
job = HelloJob.perform_later
job.cancel

Or

HelloJob.cancel(job id) # You must use the job id that Active Job provided.

If you want to use an id that backend job provided, use the cancel_by method.

HelloJob.cancel_by(provider_job_id: job_id)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/y-yagi/activejob-cancel. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.