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
- `php leaf queue:install` - Generate and run a schema file for the queue table.
74
-
- `php leaf queue:run` - Start the queue worker. -->
75
-
76
66
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.
77
67
78
68
## Creating a job
@@ -225,6 +215,16 @@ Just as with every other aspect of Leaf, we try to set everything up for you so
225
215
- 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.
226
216
- 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.
227
217
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
+
228
228
## Configuration
229
229
230
230
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 [
259
259
| used by your application. An example configuration is provided for
260
260
| each backend supported by Leaf. You're also free to add more.
0 commit comments