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

Pass the queue into the message object on initialize. #127

Merged
merged 1 commit into from
Sep 6, 2015

Conversation

Senjai
Copy link
Contributor

@Senjai Senjai commented Sep 1, 2015

Instead of just passing in the queue url, pass in the queue instead. We
can take what information we need, or delegate certain behavior if we
choose to store the queue which would require no further interface
changes.

else
# TODO: Remove next major release
Shoryuken.loggger.warn do
"[DEPRECATION] Passing a queue url into Shoryuken::Message is deprecated, please pass the queue itself"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@Senjai Senjai force-pushed the queue_args branch 2 times, most recently from 649d83f to 22f11d2 Compare September 1, 2015 20:24
attr_accessor :client, :queue_url, :queue_name, :data

def initialize(client, queue, data)
client = client

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless assignment to variable - client.

Instead of just passing in the queue url, pass in the queue instead. We
can take what information we need, or delegate certain behavior if we
choose to store the queue which would require no further interface
changes.
@phstc
Copy link
Collaborator

phstc commented Sep 6, 2015

Hi @Senjai

This is basically adding the queue_name to the Message object, right? Where/how do you use this info? What's the motivation/purpose on that?

@Senjai
Copy link
Contributor Author

Senjai commented Sep 6, 2015

We use several queues and a broker to manage them. We use a general failure
queue that is managed by another application. The queue name tells us where
the message was originally placed so we can debug it from there. Its purely
informal.

The assignment makes it easy, i can remove it, if we keep the queue as an
argument I can extend it in my wrapper. Thoughts?

phstc added a commit that referenced this pull request Sep 6, 2015
Pass the queue into the message object on initialize.
@phstc phstc merged commit 8eec377 into ruby-shoryuken:master Sep 6, 2015
@phstc
Copy link
Collaborator

phstc commented Sep 6, 2015

@Senjai gotcha. Makes sense. Thanks, added to master 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants