Skip to content

Commit 6c39112

Browse files
Enhance queue documentation with background connection details (#10898)
* Enhance queue documentation with background connection details Updated documentation to include 'background' connection for low-traffic applications and clarified queue driver behavior. For laravel/framework#57648 * Fix typo in background dispatching section * Update queues.md * Update queues.md --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 9f7c0fd commit 6c39112

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

queues.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,12 @@ RecordDelivery::dispatch($order)->onConnection('deferred');
979979

980980
The `deferred` connection also serves as the default [failover queue](#queue-failover).
981981

982+
Similarly, the `background` connection processes jobs after the HTTP response has been sent to the user; however, the job is processed in a separately spawned PHP process, allowing the PHP-FPM / application worker to be available to handle another incoming HTTP request:
983+
984+
```php
985+
RecordDelivery::dispatch($order)->onConnection('background');
986+
```
987+
982988
<a name="jobs-and-database-transactions"></a>
983989
### Jobs & Database Transactions
984990

@@ -1551,7 +1557,7 @@ php artisan queue:work database
15511557
```
15521558

15531559
> [!NOTE]
1554-
> You do not need to run a worker for connections using the `sync` or `deferred` queue drivers since those drivers process jobs within the current PHP process.
1560+
> You do not need to run a worker for connections using the `sync`, `background`, or `deferred` queue drivers since those drivers process jobs within the current PHP process.
15551561
15561562
When a queue connection operation fails and failover is activated, Laravel will dispatch the `Illuminate\Queue\Events\QueueFailedOver` event, allowing you to report or log that a queue connection has failed.
15571563

0 commit comments

Comments
 (0)