From d0abba57b91465174b186a91f17cf5efb6542e3b Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 23 Oct 2020 20:20:34 +0530 Subject: [PATCH 1/5] Add info for QueueManager::push() options to docblock. --- src/QueueManager.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/QueueManager.php b/src/QueueManager.php index acc7ec6..c1f79b8 100644 --- a/src/QueueManager.php +++ b/src/QueueManager.php @@ -155,8 +155,22 @@ public static function engine(string $name): SimpleClient * to a statically callable function. When an array is used, the * class will be constructed by Queue\Processor and have the * named method invoked. - * @param array $args An array of data to set for the job - * @param array $options An array of options for publishing the job + * @param array $args An array of data to set for the job. + * @param array $options An array of options for publishing the job: + * - `config` - A queue config name. Defaults to 'default'. + * - `delay` - Time (in integer seconds) to delay message, after which it + * will be processed. Not all message brokers accept this. Default `null`. + * - `expires` - Time (in integer seconds) after which the message expires. + * The message will be removed from the queue if this time is exceeded + * and it has not been consumed. Default `null`. + * - `priority` - Valid values: + * - `\Enqueue\Client\MessagePriority::VERY_LOW` + * - \Enqueue\Client\MessagePriority::LOW` + * - `\Enqueue\Client\MessagePriority::NORMAL` + * - `\Enqueue\Client\MessagePriority::HIGH` + * - `\Enqueue\Client\MessagePriority::VERY_HIGH` + * - `queue` - The name of a queue to use, from queue `config` array or + * string 'default' if empty. * @return void */ public static function push($callable, array $args = [], array $options = []): void From a7c7e3e2d150377a416bf2a9f9bfe604ca9e9779 Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 23 Oct 2020 20:27:10 +0530 Subject: [PATCH 2/5] Remove outdated info about Mailer\QueueTrait. --- docs/en/index.rst | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/en/index.rst b/docs/en/index.rst index 1cc549c..516a4c7 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -218,14 +218,7 @@ a ``Processor:ACK``. The exposed ``QueueTrait::push()`` method has a similar signature to ``Mailer::send()``, and also supports an ``$options`` array argument. The options this array holds are the same options as those available for -``QueueManager::push()``, and additionally supports the following: - -- ``emailClass``: - - - default: ``Cake\Mailer\Email::class`` - - description: The name of an email class to instantiate for use with the mailer - - type: string - +``QueueManager::push()``. Run the worker ============== From 40bdee96a7ec070b1c5728a52e3d678d7702c10f Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 23 Oct 2020 20:30:38 +0530 Subject: [PATCH 3/5] Update section regarding plugin's global config. --- docs/en/index.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/index.rst b/docs/en/index.rst index 516a4c7..b18b10f 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -35,9 +35,9 @@ the ``Application::bootstrap()`` function:: Configuration ============= -The following configuration should be present in your **config/app.php**:: +The following configuration should be present in the config array of your **config/app.php**:: - $config = [ + // ... 'Queue' => [ 'default' => [ // A DSN for your configured backend. default: null @@ -53,8 +53,8 @@ The following configuration should be present in your **config/app.php**:: // The name of an event listener class to associate with the worker 'listener' => \App\Listener\WorkerListener::class, ] - ] - ]; + ], + // ... The ``Queue`` config key can contain one or more queue configurations. Each of these is used for interacting with a different queuing backend. From b5f19638ed93b3ecd2921685461448e3073560b4 Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 23 Oct 2020 20:34:23 +0530 Subject: [PATCH 4/5] Add types to example codes. --- docs/en/index.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/en/index.rst b/docs/en/index.rst index b18b10f..d904398 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -69,6 +69,8 @@ Create a Job class:: setTo($emailAddress) From ca999f5c4d8e0de42af6ea0cb575f6a440a3cf0e Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 23 Oct 2020 22:00:42 -0400 Subject: [PATCH 5/5] Update src/QueueManager.php --- src/QueueManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/QueueManager.php b/src/QueueManager.php index c1f79b8..acd5e05 100644 --- a/src/QueueManager.php +++ b/src/QueueManager.php @@ -165,7 +165,7 @@ public static function engine(string $name): SimpleClient * and it has not been consumed. Default `null`. * - `priority` - Valid values: * - `\Enqueue\Client\MessagePriority::VERY_LOW` - * - \Enqueue\Client\MessagePriority::LOW` + * - `\Enqueue\Client\MessagePriority::LOW` * - `\Enqueue\Client\MessagePriority::NORMAL` * - `\Enqueue\Client\MessagePriority::HIGH` * - `\Enqueue\Client\MessagePriority::VERY_HIGH`