Skip to content

minhajuddin/sidekiq-controlled-concurrency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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