Skip to content

Commit 6507590

Browse files
committed
feat: update queue docs
1 parent 206c2af commit 6507590

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/docs/utils/queues.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,15 @@ To get started with Queues in Leaf, you need to install the `leaf/queue` package
5454
::: code-group
5555

5656
```bash:no-line-numbers [Leaf CLI]
57-
leaf install queue@v4.0-beta
57+
leaf install queue
5858
```
5959

6060
```bash:no-line-numbers [Composer]
61-
composer require leafs/queue:v4.0-beta
61+
composer require leafs/queue
6262
```
6363

6464
:::
6565

66-
This will install the Leaf Queue package and set up the necessary files and commands for you to start using queues in your Leaf app.
67-
68-
<!-- This should give you access to the following commands:
69-
70-
- `php leaf config:publish queue` - Generate a queue configuration file.
71-
- `php leaf g:job` - Generate a job class.
72-
- `php leaf d:job` - Delete a job class.
73-
- `php leaf queue:install` - Generate and run a schema file for the queue table.
74-
- `php leaf queue:run` - Start the queue worker. -->
75-
7666
By default, Leaf MVC uses your database as the queue backend, storing jobs in a `leaf_php_jobs` table. If you're fine with these defaults, just restart your server—Leaf will detect the queue setup and automatically start processing jobs alongside the PHP and Vite servers.
7767

7868
## Creating a job
@@ -225,6 +215,16 @@ Just as with every other aspect of Leaf, we try to set everything up for you so
225215
- Queues are completely stateless. This means that you can't access the current request, user, session, or any other stateful data in your jobs. If you need to access the current request, you should pass the necessary data to the job as a parameter.
226216
- Due to its simplicity, Leaf's queue system is not as feature-rich as other queue systems like Laravel's. We are working on adding more features to the queue system.
227217

218+
## Switching to Redis
219+
220+
Leaf's queue system uses the database as the default queue backend. If you want to use Redis instead, you can change the default queue connection in your `.env` file:
221+
222+
```env:no-line-numbers
223+
QUEUE_CONNECTION=redis
224+
```
225+
226+
This will switch to using your Redis connection for the queue. Leaf Redis currently only supports one connection, but we are working on adding support for multiple connections.
227+
228228
## Configuration
229229

230230
If you want to change the default config for the queues and workers, you need to publish the queue config file using the MVC console:
@@ -259,7 +259,7 @@ return [
259259
| used by your application. An example configuration is provided for
260260
| each backend supported by Leaf. You're also free to add more.
261261
|
262-
| Drivers: "database", "redis (BETA)", "file (WIP)"
262+
| Drivers: "redis", "database", "file (BETA)"
263263
|
264264
*/
265265
'connections' => [
@@ -272,7 +272,7 @@ return [
272272
'redis' => [
273273
'driver' => 'redis',
274274
'connection' => _env('REDIS_QUEUE_CONNECTION', 'default'),
275-
'queue' => _env('REDIS_QUEUE', 'default'),
275+
'table' => _env('REDIS_QUEUE', 'leaf_php_jobs'),
276276
],
277277
],
278278
];

0 commit comments

Comments
 (0)