Skip to content

sadikay/sidekiq_send_to_worker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%