-
Notifications
You must be signed in to change notification settings - Fork 436
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
WIP: Add support for using a pre-configured client with the SQS driver #444
Merged
makasim
merged 9 commits into
php-enqueue:master
from
elazar:feature/sqs-connection-factory-client
Jul 10, 2018
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bc4e949
Add support for using a pre-configured client with the SQS driver
elazar b2e9613
Move client passed to SqsConnectionFactory out of config array
elazar a137a61
Use client defined in configuration in SqsConnectionFactory
rpkamp 5a466f0
Merge pull request #1 from rpkamp/feature/sqs-connection-factory-client
elazar 9b4ccd2
Fix SqsTransportFactory
elazar 0aac004
Restore use cases in UseCasesTest
elazar ce0db47
Fix test failures
elazar 610add1
Fix SqsConnectionFactory test
elazar df3de8c
Add SQS defaults to custom config
elazar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,6 +228,7 @@ enqueue: | |
polling_interval: 1000 | ||
lazy: true | ||
sqs: | ||
client: null | ||
key: null | ||
secret: null | ||
token: null | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,10 +34,11 @@ public function addConfiguration(ArrayNodeDefinition $builder) | |
{ | ||
$builder | ||
->children() | ||
->scalarNode('client')->defaultNull()->end() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would expect there to be something like the following in
|
||
->scalarNode('key')->defaultNull()->end() | ||
->scalarNode('secret')->defaultNull()->end() | ||
->scalarNode('token')->defaultNull()->end() | ||
->scalarNode('region')->isRequired()->end() | ||
->scalarNode('region')->end() | ||
->integerNode('retries')->defaultValue(3)->end() | ||
->scalarNode('version')->cannotBeEmpty()->defaultValue('2012-11-05')->end() | ||
->booleanNode('lazy') | ||
|
@@ -53,8 +54,10 @@ public function addConfiguration(ArrayNodeDefinition $builder) | |
*/ | ||
public function createConnectionFactory(ContainerBuilder $container, array $config) | ||
{ | ||
$arguments = empty($config['client']) ? $config : new Reference($config['client']); | ||
|
||
$factory = new Definition(SqsConnectionFactory::class); | ||
$factory->setArguments([$config]); | ||
$factory->setArguments([$arguments]); | ||
|
||
$factoryId = sprintf('enqueue.transport.%s.connection_factory', $this->getName()); | ||
$container->setDefinition($factoryId, $factory); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think the constructor should accept an instance of Client, no need to pass it as an array parameter. We would not be able to apply other options in the array in any case.
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.
The symfony transport should have it as a client option though
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.
Done.