From f3cfec5fd4748bfc806520ff4f9bfda03ef2519b Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 25 Nov 2024 10:17:06 -0500 Subject: [PATCH 1/4] DOCSP-42020: queues feedback (cherry picked from commit 830ba9f2ab00f637c30e1f2526ea4b18ddc4ab0c) --- docs/queues.txt | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/docs/queues.txt b/docs/queues.txt index 5e25d868b..379feeb9e 100644 --- a/docs/queues.txt +++ b/docs/queues.txt @@ -11,6 +11,16 @@ Queues .. meta:: :keywords: php framework, odm, code example, jobs +Overview +-------- + +In this guide, you can learn how to use MongoDB as your database for +Laravel Queue. Laravel Queue allows you to create queued jobs that can +processed in the background. + +Configuration +------------- + To use MongoDB as your database for Laravel Queue, change the driver in your application's ``config/queue.php`` file: @@ -22,7 +32,7 @@ the driver in your application's ``config/queue.php`` file: // You can also specify your jobs-specific database // in the config/database.php file 'connection' => 'mongodb', - 'collection' => 'jobs', + 'table' => 'jobs', 'queue' => 'default', // Optional setting // 'retry_after' => 60, @@ -48,7 +58,7 @@ the behavior of the queue: ``mongodb`` connection. The driver uses the default connection if a connection is not specified. - * - ``collection`` + * - ``table`` - **Required** Name of the MongoDB collection to store jobs to process. @@ -60,7 +70,7 @@ the behavior of the queue: before retrying a job that is being processed. The value is ``60`` by default. -To use MongoDB to handle failed jobs, create a ``failed`` entry in your +To use MongoDB to handle *failed jobs*, create a ``failed`` entry in your application's ``config/queue.php`` file and specify the database and collection: @@ -69,7 +79,7 @@ collection: 'failed' => [ 'driver' => 'mongodb', 'database' => 'mongodb', - 'collection' => 'failed_jobs', + 'table' => 'failed_jobs', ], The following table describes properties that you can specify to configure @@ -91,16 +101,13 @@ how to handle failed jobs: a ``mongodb`` connection. The driver uses the default connection if a connection is not specified. - * - ``collection`` + * - ``table`` - Name of the MongoDB collection to store failed jobs. The value is ``failed_jobs`` by default. -Then, add the service provider in your application's -``config/app.php`` file: - -.. code-block:: php - - MongoDB\Laravel\MongoDBQueueServiceProvider::class, +The {+odm-short+} automatically provides the +``MongoDB\Laravel\MongoDBQueueServiceProvider::class`` class as the +service provider to handle failed jobs. Job Batching ------------ @@ -124,7 +131,7 @@ application's ``config/queue.php`` file: 'batching' => [ 'driver' => 'mongodb', 'database' => 'mongodb', - 'collection' => 'job_batches', + 'table' => 'job_batches', ], The following table describes properties that you can specify to configure @@ -146,13 +153,13 @@ job batching: ``mongodb`` connection. The driver uses the default connection if a connection is not specified. - * - ``collection`` + * - ``table`` - Name of the MongoDB collection to store job batches. The value is ``job_batches`` by default. Then, add the service provider in your application's ``config/app.php`` file: -.. code-block:: php - - MongoDB\Laravel\MongoDBBusServiceProvider::class, +The {+odm-short+} automatically provides the +``MongoDB\Laravel\MongoDBBusServiceProvider::class`` class as the +service provider for job batching. From fe863fdd7a900678b7f42a2754666a4afa4d9693 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 25 Nov 2024 10:31:49 -0500 Subject: [PATCH 2/4] DOCSP-42020: queues feedback - 5.0+ --- docs/queues.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/queues.txt b/docs/queues.txt index 379feeb9e..a05e08219 100644 --- a/docs/queues.txt +++ b/docs/queues.txt @@ -105,9 +105,11 @@ how to handle failed jobs: - Name of the MongoDB collection to store failed jobs. The value is ``failed_jobs`` by default. -The {+odm-short+} automatically provides the -``MongoDB\Laravel\MongoDBQueueServiceProvider::class`` class as the -service provider to handle failed jobs. +To register failed jobs, you can use the default failed +job provider from Laravel. To learn more, see +`Dealing With Failed Jobs +`__ in +the Laravel documentation on Queues. Job Batching ------------ From db45fdb0c23f2e59a00a643e5e73a989652704d7 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 25 Nov 2024 12:09:11 -0500 Subject: [PATCH 3/4] JS small fix --- docs/queues.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/queues.txt b/docs/queues.txt index a05e08219..84b358ba5 100644 --- a/docs/queues.txt +++ b/docs/queues.txt @@ -15,7 +15,7 @@ Overview -------- In this guide, you can learn how to use MongoDB as your database for -Laravel Queue. Laravel Queue allows you to create queued jobs that can +Laravel Queue. Laravel Queue allows you to create queued jobs that are processed in the background. Configuration From 7bd26ebedcd6f0af3ffd8b1667a0f463ab532b34 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 2 Dec 2024 10:05:30 -0500 Subject: [PATCH 4/4] replace cxn with db in tables --- docs/queues.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/queues.txt b/docs/queues.txt index 84b358ba5..951853084 100644 --- a/docs/queues.txt +++ b/docs/queues.txt @@ -96,7 +96,7 @@ how to handle failed jobs: - **Required** Queue driver to use. The value of this property must be ``mongodb``. - * - ``connection`` + * - ``database`` - Database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified. @@ -150,7 +150,7 @@ job batching: - **Required** Queue driver to use. The value of this property must be ``mongodb``. - * - ``connection`` + * - ``database`` - Database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified.