-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial delayed jobs implementation #4
base: master
Are you sure you want to change the base?
Conversation
@@ -6,7 +6,7 @@ class Job | |||
class << self | |||
include Utils | |||
|
|||
def options(queue_name:, ack: false, consumers: 5, durable: true, persist: false) | |||
def options(queue_name:, ack: false, consumers: 5, durable: true, persist: false, delay: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add delay in the options.
@consumer_threads << Thread.new { consumer.consume! } | ||
@consumers.times do |n| | ||
@consumer_threads << Thread.new do | ||
sleep Random.new.rand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line 😅
mapped_options[mapped_key] = value | ||
elsif mapped_key = original_options[:__headers][key] | ||
mapped_options[:headers][mapped_key] = value | ||
end | ||
mapped_options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we start to introduce Option classes for rabbitmq queues?
resolves #3