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

sidekiq-dynamic-queues

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sidekiq-dynamic-queues

  • 0.6.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

A sidekiq plugin for specifying the queues a worker pulls from with wildcards, negations, or dynamic look up from redis.

Authored against Sidekiq 2.9.0, so it at least works with that - try running the tests if you use a different version of sidekiq

Build Status

Usage:

If creating a gem of your own that uses sidekiq-dynamic-queues, you may have to add an explicit require statement at the top of your Rakefile:

require 'sidekiq-dynamic-queues'

Configure by:

Sidekiq.configure_server do |config|
    config.options[:fetch] = Sidekiq::DynamicQueues::Fetch
end

Start your workers with a queue that can contain '*' (.star.) for zero-or more of any character, '!' (.not.) to exclude the following pattern, or @key (.at.key) to look up the patterns from redis. The version in parens is required to get around the sidekiq cli's restriction on queue names. Some examples help:

sidekiq -q foo

Pulls jobs from the queue 'foo'

sidekiq -q .star.

Pulls jobs from any queue

sidekiq -q .star.foo

Pulls jobs from queues that end in foo

sidekiq -q .star.foo.star.

Pulls jobs from queues whose names contain foo

sidekiq -q .star.foo.star. -q .not.foobar

Pulls jobs from queues whose names contain foo except the foobar queue

sidekiq -q .star.foo.star. -q .not..star.bar

Pulls jobs from queues whose names contain foo except queues whose names end in bar

sidekiq -q .at.key

Pulls jobs from queue names stored in redis (use Sidekiq::DynamicQueues::Attributes.set_dynamic_queue("key", ["queuename1", "queuename2"]) to set them)

sidekiq -q .star. -q .not..at.key

Pulls jobs from any queue except ones stored in redis

sidekiq -q .at.

Pulls jobs from queue names stored in redis using the hostname of the worker

Sidekiq::DynamicQueues::Attributes.set_dynamic_queue("key", ["*foo*", "!*bar"])
sidekiq -q .at.key 

Pulls jobs from queue names stored in redis, with wildcards/negations

There is also a tab in the sidekiq-web UI that allows you to define the dynamic queues To activate it, you need to require 'sidekiq-dynamic-queues-server' in whatever initializer you use to bring up sidekiq-web.

Contributors:

Matt Conway ( https://github.com/wr0ngway )

FAQs

Package last updated on 04 Mar 2014

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