Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XZzYassin
Copy link
Collaborator

@XZzYassin XZzYassin commented Dec 27, 2020

resolves #3

@XZzYassin XZzYassin added the help wanted Extra attention is needed label Dec 27, 2020
@XZzYassin XZzYassin added this to To-Do in Roadmap via automation Dec 27, 2020
@XZzYassin XZzYassin removed this from To-Do in Roadmap Dec 27, 2020
@@ -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)
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Rabbitmq] Scheduled Jobs
2 participants