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

Memoize Shoryuken::Queue#visibility_timeout to avoid hitting SQS API multiple times #531

Closed
wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 6, 2018

Add some memoization on Shoryuken::Queue#visibility_timeout to avoid hitting SQS API multiple times.

@ghost ghost changed the title Add memoize pm Memoize Shoryuken::Queue#visibility_timeout to avoid hitting SQS API multiple times Nov 6, 2018
@@ -14,7 +14,7 @@ def initialize(client, name_or_url)
end

def visibility_timeout
queue_attributes.attributes[VISIBILITY_TIMEOUT_ATTR].to_i
@visibility_timeout ||= queue_attributes.attributes[VISIBILITY_TIMEOUT_ATTR].to_i
Copy link
Collaborator

@phstc phstc Nov 6, 2018

Choose a reason for hiding this comment

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

Hi @julien-unitylab

For FIFO, it is easy to merge the memoization (#529), since a FIFO queue can't be changed to a standard queue, so that value once it is loaded, won't change.

But for the visibility timeout, it can change. If we memoize it, Shoryuken processes will need to be restarted to catch up with the changes.

I'm wondering if this could be an option in the shoryuken.yml#cache_visibility_timeout (default to false for not introducing break changes).

WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @julien-unitylab

Did you have a chance to check that ☝️

Copy link
Collaborator

Choose a reason for hiding this comment

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

I created another PR with the proposed fix #533

Copy link
Author

@ghost ghost Nov 19, 2018

Choose a reason for hiding this comment

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

Hello @phstc,
I'm really sorry for my late reply, thanks to have taken care of this :).
Let's continue on #533.

Cheers

@ghost ghost closed this Nov 19, 2018
This pull request was closed.
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.

1 participant