Skip to content

Commit 601d34e

Browse files
committed
Update documentation to reflect named providers
1 parent ca234ff commit 601d34e

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

docs/aws-provider.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ credentials in your configuration.
2828
2929
uecode_qpush:
3030
providers:
31-
aws:
31+
my_provider:
32+
driver: aws
3233
key: <aws key>
3334
secret: <aws secret>
3435
region: us-east-1
3536
queues:
3637
my_queue_name:
37-
provider: aws
38+
provider: my_provider
3839
options:
3940
push_notifications: true
4041
subscribers:

docs/configuration.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,24 @@ A working configuration would look like the following
107107
logging_enabled: true
108108
providers:
109109
aws:
110+
driver: aws #optional for providers named 'aws' or 'ironmq'
111+
key: YOUR_AWS_KEY_HERE
112+
secret: YOUR_AWS_SECRET_HERE
113+
region: YOUR_AWS_REGION_HERE
114+
another_aws_provider:
115+
driver: aws #required for named providers
110116
key: YOUR_AWS_KEY_HERE
111117
secret: YOUR_AWS_SECRET_HERE
112118
region: YOUR_AWS_REGION_HERE
113119
ironmq:
120+
driver: aws #optional for providers named 'aws' or 'ironmq'
114121
token: YOUR_IRONMQ_TOKEN_HERE
115122
project_id: YOUR_IRONMQ_PROJECT_ID_HERE
123+
in_band:
124+
driver: sync
116125
queues:
117126
my_queue_key:
118-
provider: ironmq #or aws or sync
127+
provider: ironmq #or aws or in_band or another_aws_provider
119128
options:
120129
queue_name: my_actual_queue_name
121130
push_notifications: true

docs/iron-mq-provider.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,24 @@ an account and have a project id.
3030
testing and using this service extremely easy.
3131

3232
Just include your OAuth `token` and `project_id` in the configuration and set your
33-
queue to use the `ironmq` provider.
33+
queue to use a provider using the `ironmq` driver.
3434

3535
.. code-block:: yaml
3636
3737
#app/config.yml
3838
3939
uecode_qpush:
4040
providers:
41-
ironmq:
41+
my_provider:
42+
driver: ironmq
4243
token: YOUR_TOKEN_HERE
4344
project_id: YOUR_PROJECT_ID_HERE
4445
host: YOUR_OPTIONAL_HOST_HERE
4546
port: YOUR_OPTIONAL_PORT_HERE
4647
version_id: YOUR_OPTIONAL_VERSION_HERE
4748
queues:
4849
my_queue_name:
49-
provider: ironmq
50+
provider: my_provider
5051
options:
5152
push_notifications: true
5253
subscribers:

src/DependencyInjection/UecodeQPushExtension.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ public function load(array $configs, ContainerBuilder $container)
6060
$class = null;
6161
$client = null;
6262

63-
switch ($config['providers'][$provider]['driver']) {
63+
$driver = isset($config['providers'][$provider]['driver']) ?
64+
$config['providers'][$provider]['driver']
65+
: $provider;
66+
67+
switch ($driver) {
6468
case 'aws':
6569
$class = $container->getParameter('uecode_qpush.provider.aws');
6670
$client = $this->createAwsClient(

0 commit comments

Comments
 (0)