Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in SQLite queue information to docs #973

Merged
merged 2 commits into from
Nov 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions docs-site/content/docs/processing/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Loco provides the following options for background jobs:

* Redis backed (powered by `sidekiq-rs`)
* Postgres backed (own implementation)
* SQLite backed (own implementation)
* Tokio-async based (same-process, evented thread based background jobs)


Expand Down Expand Up @@ -57,11 +58,21 @@ Or a Postgres based queue backend:
```yaml
queue:
kind: Postgres
# Redis connection URI
# Postgres Queue connection URI
uri: "{{ get_env(name="PGQ_URL", default="postgres://localhost:5432/mydb") }}"
dangerously_flush: false
```

Or a SQLite based queue backend:

```yaml
queue:
kind: Sqlite
# SQLite Queue connection URI
uri: "{{ get_env(name="SQLTQ_URL", default="sqlite://loco_development.sqlite?mode=rwc") }}"
dangerously_flush: false
```

## Running the worker process
You can run in two ways, depending on which setting you chose for background workers:

Expand Down Expand Up @@ -164,7 +175,7 @@ The worker generator creates a worker file associated with your app and generate

In your `config/<environment>.yaml` you can specify the worker mode. BackgroundAsync and BackgroundQueue will process jobs in a non-blocking manner, while ForegroundBlocking will process jobs in a blocking manner.

The main difference between BackgroundAsync and BackgroundQueue is that the latter will use Redis to store the jobs, while the former does not require Redis and will use async within the same process.
The main difference between BackgroundAsync and BackgroundQueue is that the latter will use Redis/Postgres/SQLite to store the jobs, while the former does not require Redis/Postgres/SQLite and will use async in memory within the same process.

```yaml
# Worker Configuration
Expand Down
Loading