README.md in sidekiq-status-0.6.0 vs README.md in sidekiq-status-0.7.0

- old
+ new

@@ -8,12 +8,23 @@ An extension to [Sidekiq](http://github.com/mperham/sidekiq) message processing to track your jobs. Inspired by [resque-status](http://github.com/quirkey/resque-status) and mostly copying its features, using Sidekiq's middleware. ## Installation -gem install sidekiq-status +Add this line to your application's Gemfile: +```ruby +gem 'sidekiq-status' +``` +And then execute: + + $ bundle + +Or install it yourself as: + + gem install sidekiq-status + ## Usage ### Configuration Configure your middleware chains, lookup [Middleware usage](https://github.com/mperham/sidekiq/wiki/Middleware) @@ -113,11 +124,11 @@ # a way to associate data with your job store vino: 'veritas' # a way of retrieving said data - # remember that retrieved data is always is String|nil + # remember that retrieved data is always String|nil vino = retrieve :vino end end job_id = MyJob.perform_async(*args) @@ -143,14 +154,22 @@ Sidekiq::Status.unschedule '' #=> false # Note: cancel and unschedule are alias methods. ``` Important: If you try any of the status method after the expiration time for scheduled jobs, will result into `nil` or `false`. But job will be in sidekiq's scheduled queue and will execute normally, once job is started on scheduled time you will get status info for job till expiration time defined on `Sidekiq::Status::ServerMiddleware`. +### Deleting Status by Job ID +```ruby +# returns number of keys/jobs that were removed +Sidekiq::Status.delete(job_id) #=> 1 +Sidekiq::Status.delete(bad_job_id) #=> 0 +``` + ### Sidekiq web integration -Sidekiq::Status also provides an extension to Sidekiq web interface with a `/statuses`. -![Sidekiq Status Web](https://raw.github.com/utgarda/sidekiq-status/master/web/sidekiq-status-web.png) +Sidekiq::Status also provides an extension to Sidekiq web interface with an index at `/statuses` and a single job at `/statuses/123`. +![Sidekiq Status Web](web/sidekiq-status-web.png) +![Sidekiq Status Web](web/sidekiq-status-single-web.png) Setup Sidekiq web interface according to Sidekiq documentation and add the Sidekiq::Status::Web require: ``` ruby require 'sidekiq/web' @@ -175,14 +194,21 @@ To use `sidekiq-status` inlining, require it too in your `{test,spec}_helper.rb`: `require 'sidekiq-status/testing/inline'` +## Contributing -### Features coming -* Stopping jobs by id +Bug reports and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct. +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes along with test cases (`git commit -am 'Add some feature'`) +4. If possible squash your commits to one commit if they all belong to same feature. +5. Push to the branch (`git push origin my-new-feature`) +6. Create new Pull Request. + ## Thanks * Pramod Shinde * Clay Allsopp * Andrew Korzhuev * Jon Moses @@ -192,6 +218,6 @@ * Mohammed Elalj * Ben Sharpe ## License MIT License , see LICENSE for more details. -© 2012 - 2015 Evgeniy Tsvigun +© 2012 - 2016 Evgeniy Tsvigun