No commit activity in last 3 years
No release in over 3 years
Enqueue job from another projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 4.2
 Project Readme

Sidekiq Send To Worker

Code Climate

This gem provides enqueue jobs from another projects

Installing

gem 'sidekiq_runner'
gem 'sidekiq_send_to_worker'

Add send_to_worker to your queues in sidekiq.yml

Example

# Your worker
class UrlShortenerWorker
  include Sidekiq::Worker
  
  sidekiq_options backtrace: true, queue: 'url_shortener', retry: 2
 
  include SidekiqRunner::SidekiqPerform

  def create_from_google(params)
    # id = params[:id]
    # Video.find(id)
    # Do something here
  end
  
  def create_from_bitly(params)
    # id = params[:id]
    # Video.find(id)
    # Do something here
  end
  
  def my_other_method
    # Do something here
  end
end

Send Job To Workers

SidekiqSendToWorker::Sender.perform_async('UrlShortenerWorker', 'create_from_google', {a:1, b:2} )

Running Tests

$ bundle install
$ bundle exec rake test

If you need to test against local gems, use Bundler's gem :path option in the Gemfile and also edit test/support/test_helper.rb and tell the tests where the gem is checked out.