Skip to content

Commit

Permalink
Merge branch 'master' into feature/nesting-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
DenuxPlays committed Feb 3, 2025
2 parents a43fba7 + 826e150 commit 5eea60a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs-site/content/docs/processing/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,39 @@ Then, configure a Redis based queue backend:
```yaml
queue:
kind: Redis
# Redis connection URI
# Redis connection URI.
uri: "{{ get_env(name="REDIS_URL", default="redis://127.0.0.1") }}"
# Dangerously flush all data.
dangerously_flush: false
# represents the number of tasks a worker can handle simultaneously.
num_workers: 2
```
Or a Postgres based queue backend:
```yaml
queue:
kind: Postgres
# Postgres Queue connection URI
# Postgres Queue connection URI.
uri: "{{ get_env(name="PGQ_URL", default="postgres://localhost:5432/mydb") }}"
# Dangerously flush all data.
dangerously_flush: false
# represents the number of tasks a worker can handle simultaneously.
num_workers: 2
```
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") }}"
# SQLite Queue connection URI.
uri: "{{ get_env(name="SQLTQ_URL", default="sqlite://loco_development.sqlite?
mode=rwc") }}"
# Dangerously flush all data.
dangerously_flush: false
# represents the number of tasks a worker can handle simultaneously.
num_workers: 2
```
## Running the worker process
Expand Down
2 changes: 2 additions & 0 deletions src/controller/app_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ impl AppRoutes {
/// In the following example, you are adding `api` as a prefix and then nesting a route within it:
///
/// ```rust, no_run
/// use reqwest::get;
/// use loco_rs::controller::{AppRoutes, Routes};
///
/// let route = Routes::new().add("/notes", get(|| async { "notes" }));
Expand Down Expand Up @@ -204,6 +205,7 @@ impl AppRoutes {
/// In the following example, you are adding `api` as a prefix and then nesting multiple routes within it:
///
/// ```rust, no_run
/// use reqwest::get;
/// use loco_rs::controller::{AppRoutes, Routes};
///
/// let routes = vec![
Expand Down

0 comments on commit 5eea60a

Please sign in to comment.