Skip to content

minhajuddin/sidekiq-controlled-concurrency

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Controlled Enqueue

Allow jobs to enqueued in a controlled fashion

Test

Open 3 terminals

The first for sidekiq

# 1. sidekiq
$ bundle exec sidekiq --concurrency 10 --require ./app.rb

The second for the enqueuer

# 2. enqueuer
$ bundle exec ruby ./enqueuer.rb

At this point the enqueuer shouldn't be able to enqueue any jobs, because the concurrency at this stage is set to 0

# 3. ruby console
$ bundle exec irb
> require_relative './app.rb'
# set the concurrency to 3
> ControlledEnqueue.setup(concurrency: 3)

Now you should see 3 jobs enqueuing at a time

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages