-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Add aws configuration in 'Shoryuken.configure_server' #252
Conversation
receive_message | ||
).map(&:to_sym) | ||
|
||
aws_options = hash.reject do |k, v| |
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.
Unused block argument - v. If it's necessary, use _ or _v as an argument name to indicate that it won't be used.
@options ||= {} | ||
end | ||
|
||
def options=(hash) |
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.
Use attr_writer to define trivial writer methods.
@@ -0,0 +1,49 @@ | |||
module Shoryuken | |||
class AwsConfig | |||
|
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.
Extra empty line detected at class body beginning.
@phstc I create sample pull request in my repository: h3poteto#2 But, now developers use |
@@ -118,6 +131,10 @@ def on_stop(&block) | |||
@stop_callback = block | |||
end | |||
|
|||
def aws=(hash) | |||
@aws = Shoryuken::AwsConfig.setup(hash) | |||
end |
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.
@h3poteto is @aws
being used?
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.
Sorry, @aws
is not used!
Hi there! what do you think of this @phstc? looks like something that you would like to merge eventually? just wondering because I was looking for a good way to decouple the general AWS config of my application from the one that Shoryuken should use. I have 3 different users with different permissions in my app, one is for general purposes like store stuff in S3. Other is handling keys with the KMS, and was expecting to be able to have the last one to be in charge of the queues and jobs/workers, but the way is right now seems that if I passed the And also on the Let me know if this is not clear at all, and also if you rather have this conversation on an issue or in another place, I wrote it in here because this PR looks like something that will help on this same topic. Maybe I'm wrong, don't hesitate to let me know! Thanks a lot for all the hard work on all this! 🍺 |
hi @agustin The change in this PR is still using For example, using this: sqs = Aws::SQS::Client.new(
region: region_name,
credentials: credentials,
# ...
) Instead of globally setting it |
exactly @phstc! maybe if the SNS and the SQS method on the If you are ok with that maybe I can open a PR with that feature, let me know! |
thank you! |
…I added to the AwsConfig Class the sqs and sns methods to properly instanciate a client with the credentials and avoid the override of Aws.config ones
…I added to the AwsConfig Class the sqs and sns methods to properly instanciate a client with the credentials and avoid the override of Aws.config ones - Remove a redundant private method, following @phstc comment
I add aws configuration in
Shoryuken.configure_server
, like sidekiq:https://github.com/mperham/sidekiq/blob/master/lib/sidekiq.rb#L75-L83
Now, I have to call
EnvironmentLoader.load
in initializer of my Rails application to setup aws configuration. For example:I want to divide
EnvironmentLoader.load
method, because I try to fix #249.To fix #249, shoryuken have to read
shoryuken.yml
beforedaemonize
, and then load Rails.So, I want to divide
EnvironmentLoader.load
.But, now
EnvironmentLoader.load
is used in initializer of user's Rails application, therefore I propose alternate method to configure aws in initializer. That isShoryuken.configure_server
.In sidekiq, user can configure redis information in initializer.
I aim the same way as sidekiq.