diff --git a/docs/en/index.rst b/docs/en/index.rst index 1cc549c..d904398 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. @@ -69,6 +69,8 @@ Create a Job class:: setTo($emailAddress) @@ -218,14 +222,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 ============== diff --git a/src/QueueManager.php b/src/QueueManager.php index acc7ec6..acd5e05 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