You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/queues.txt
+60-28
Original file line number
Diff line number
Diff line change
@@ -9,24 +9,29 @@ Queues
9
9
:values: tutorial
10
10
11
11
.. meta::
12
-
:keywords: php framework, odm, code example
12
+
:keywords: php framework, odm, code example, jobs
13
13
14
-
If you want to use MongoDB as your database backend for Laravel Queue, change
15
-
the driver in ``config/queue.php``:
14
+
To use MongoDB as your database for Laravel Queue, change
15
+
the driver in your application's ``config/queue.php`` file:
16
16
17
17
.. code-block:: php
18
18
19
19
'connections' => [
20
20
'database' => [
21
21
'driver' => 'mongodb',
22
-
// You can also specify your jobs specific database created on config/database.php
22
+
// You can also specify your jobs-specific database
23
+
// in the config/database.php file
23
24
'connection' => 'mongodb',
24
25
'collection' => 'jobs',
25
26
'queue' => 'default',
26
-
'retry_after' => 60,
27
+
// Optional setting
28
+
// 'retry_after' => 60,
27
29
],
28
30
],
29
31
32
+
The following table describes properties that you can specify to configure
33
+
the behavior of the queue:
34
+
30
35
.. list-table::
31
36
:header-rows: 1
32
37
:widths: 25 75
@@ -35,22 +40,29 @@ the driver in ``config/queue.php``:
35
40
- Description
36
41
37
42
* - ``driver``
38
-
- **Required**. Specifies the queue driver to use. Must be ``mongodb``.
43
+
- **Required** Queue driver to use. The value of
44
+
this property must be ``mongodb``.
39
45
40
46
* - ``connection``
41
-
- The database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified.
47
+
- Database connection used to store jobs. It must be a
48
+
``mongodb`` connection. The driver uses the default connection if
49
+
a connection is not specified.
42
50
43
51
* - ``collection``
44
-
- **Required**. Name of the MongoDB collection to store jobs to process.
52
+
- **Required** Name of the MongoDB collection to
53
+
store jobs to process.
45
54
46
55
* - ``queue``
47
-
- **Required**. Name of the queue.
56
+
- **Required** Name of the queue.
48
57
49
58
* - ``retry_after``
50
-
- Specifies how many seconds the queue connection should wait before retrying a job that is being processed. Defaults to ``60``.
59
+
- Specifies how many seconds the queue connection should wait
60
+
before retrying a job that is being processed. The value is
61
+
``60`` by default.
51
62
52
-
If you want to use MongoDB to handle failed jobs, change the database in
53
-
``config/queue.php``:
63
+
To use MongoDB to handle failed jobs, create a ``failed`` entry in your
64
+
application's ``config/queue.php`` file and specify the database and
65
+
collection:
54
66
55
67
.. code-block:: php
56
68
@@ -60,6 +72,9 @@ If you want to use MongoDB to handle failed jobs, change the database in
60
72
'collection' => 'failed_jobs',
61
73
],
62
74
75
+
The following table describes properties that you can specify to configure
76
+
how to handle failed jobs:
77
+
63
78
.. list-table::
64
79
:header-rows: 1
65
80
:widths: 25 75
@@ -68,32 +83,41 @@ If you want to use MongoDB to handle failed jobs, change the database in
68
83
- Description
69
84
70
85
* - ``driver``
71
-
- **Required**. Specifies the queue driver to use. Must be ``mongodb``.
86
+
- **Required** Queue driver to use. The value of
87
+
this property must be ``mongodb``.
72
88
73
89
* - ``connection``
74
-
- The database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified.
90
+
- Database connection used to store jobs. It must be
91
+
a ``mongodb`` connection. The driver uses the default connection
92
+
if a connection is not specified.
75
93
76
94
* - ``collection``
77
-
- Name of the MongoDB collection to store failed jobs. Defaults to ``failed_jobs``.
78
-
95
+
- Name of the MongoDB collection to store failed
96
+
jobs. The value is ``failed_jobs`` by default.
79
97
80
-
Add the service provider in ``config/app.php``:
98
+
Then, add the service provider in your application's
is a Laravel feature to execute a batch of jobs and subsequent actions before,
92
-
after, and during the execution of the jobs from the queue.
108
+
**Job batching** is a Laravel feature that enables you to execute a
109
+
batch of jobs and related actions before, after, and during the
110
+
execution of the jobs from the queue. To learn more about this feature,
111
+
see `Job Batching <https://laravel.com/docs/{+laravel-docs-version+}/queues#job-batching>`__
112
+
in the Laravel documentation.
113
+
114
+
In MongoDB, you don't have to create a designated collection before
115
+
using job batching. The ``job_batches`` collection is created
116
+
automatically to store metadata about your job batches, such as
117
+
their completion percentage.
93
118
94
-
With MongoDB, you don't have to create any collection before using job batching.
95
-
The ``job_batches`` collection is created automatically to store meta
96
-
information about your job batches, such as their completion percentage.
119
+
To enable job batching, create the ``batching`` entry in your
120
+
application's ``config/queue.php`` file:
97
121
98
122
.. code-block:: php
99
123
@@ -103,6 +127,9 @@ information about your job batches, such as their completion percentage.
103
127
'collection' => 'job_batches',
104
128
],
105
129
130
+
The following table describes properties that you can specify to configure
131
+
job batching:
132
+
106
133
.. list-table::
107
134
:header-rows: 1
108
135
:widths: 25 75
@@ -111,15 +138,20 @@ information about your job batches, such as their completion percentage.
111
138
- Description
112
139
113
140
* - ``driver``
114
-
- **Required**. Specifies the queue driver to use. Must be ``mongodb``.
141
+
- **Required** Queue driver to use. The value of
142
+
this property must be ``mongodb``.
115
143
116
144
* - ``connection``
117
-
- The database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified.
145
+
- Database connection used to store jobs. It must be a
146
+
``mongodb`` connection. The driver uses the default connection if
147
+
a connection is not specified.
118
148
119
149
* - ``collection``
120
-
- Name of the MongoDB collection to store job batches. Defaults to ``job_batches``.
150
+
- Name of the MongoDB collection to store job
151
+
batches. The value is ``job_batches`` by default.
121
152
122
-
Add the service provider in ``config/app.php``:
153
+
Then, add the service provider in your application's ``config/app.php``
0 commit comments