Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sidekiq-enqueuer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sidekiq-enqueuer

  • 2.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Sidekiq::Enqueuer

Build Status

A Sidekiq Web extension to enqueue/schedule job in Web UI. Support both Sidekiq::Worker and ActiveJob.

Installation

Add this line to your application's Gemfile:

gem 'sidekiq-enqueuer'

And then execute:

$ bundle

Edit config/initializers/sidekiq.rb, add following line

require 'sidekiq/enqueuer'

Optionally, provide a list of Jobs to display on the new tab, on a new initializer file. Worry not, when no configuration is provided, All jobs will be displayed

# config/initializers/sidekiq_enqueuer_config.rb
require 'sidekiq/enqueuer'

Sidekiq::Enqueuer.configure do |config|
  config.jobs = [MyAwesomeJob1, MyModule::MyAwesomeJob2]
end

Notes:

Queuing & ActiveJob support

Use default sidekiq queue adapter for Jobs including Sidekiq::Worker or Jobs inheriting from ActiveJob::base

ActiveJob::Base.queue_adapter = :sidekiq

https://github.com/mperham/sidekiq/wiki/Active-Job#active-job-setup

Jobs action param mapping.

This gem dynamically infers the params required in the perform or perform_in action in your Job / Worker. It is important those actions (either of them) won't hide the actual params into a single *args one. In that case it will be impossible to infer the params for your method.

Want to verify this last line? Run this in a rails console:

MyJob.instance_method(:perform).parameters            # change :perform for your implemented method
>> [[:req, :param1], [:opt, :param2], [:opt, :param3]]   # Good output

=> [[:rest, :args], [:block, :block]]   # Bad output. Params are being wrapped into a super class.

Enqueuing Jobs:

For Sidekiq, enqueing is being done using Sidekiq::Client.enqueue_to / enqueue_to_in, providing Job, and queue extracted from the Job sidekiq_options hash, defaults to 'default' queue when not present.

For ActiveJob, enqueing is being done calling the very own perform_later instance method. Please advise your Job should respond to perform_later to correctly work.

Usage

  • Open Sidekiq Web, click the Enqueuer tab.

  • You can see a list of job classes/modules and params. Click Enqueue Form.

list

  • Fill the form, click Enqueue or Schedule. form

  • That is it!

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/richfisher/sidekiq-enqueuer.

FAQs

Package last updated on 04 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc