Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Additional sidekiq middleware
Ruby
tree: 3df69f8c3c

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
sidekiq-middleware.gemspec

README.md

Additional sidekiq middleware Build Status

This gem provides additional middleware for Sidekiq.

See Sidekiq Wiki for more details.

Installation

Add this line to your application's Gemfile:

gem 'sidekiq-middleware'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sidekiq-middleware

Contents

UniqueJobs

Provides uniqueness for jobs.

Usage

Example worker:

  class UniqueWorker
    include Sidekiq::Worker

    sidekiq_options({
      # Should be set to true (enables uniqueness for async jobs)
      # or :all (enables uniqueness for both async and scheduled jobs)
      unique: :all,

      # Set this to true in case your job schedules itself
      forever: true,

      # Unique expiration (optional, default is 30 minutes)
      # For scheduled jobs calculates automatically if not provided
      expiration: 24 * 60 * 60
    })

    def perform
      # Your code goes here
    end
  end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.