Skip to content

Commit 44090a2

Browse files
authored
Fix task module examples to working one (#62)
1 parent 1d7c557 commit 44090a2

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="docs/images/logo_full.png" alt="FluxQueue" />
2+
<img src="https://fluxqueue.ccxlv.dev/images/logo_full.png" alt="FluxQueue" />
33
</p>
44

55
<div align="center">

docs/tutorial/defininig_and_exposing_tasks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ This pattern:
7777
When starting the worker, point it to your tasks module:
7878

7979
```bash
80-
fluxqueue start --tasks-module-path myapp.tasks --queue default
80+
fluxqueue start --tasks-module-path myapp/tasks --queue default
8181
```
8282

83-
The worker will import `myapp.tasks` and discover all task functions that are exposed in the module.
83+
The worker will import `myapp/tasks` and discover all task functions that are exposed in the module.
8484

8585
## How It Works
8686

@@ -145,13 +145,13 @@ __all__ = [
145145
In your first terminal:
146146

147147
```bash
148-
fluxqueue start --tasks-module-path myapp.tasks --queue default
148+
fluxqueue start --tasks-module-path myapp/tasks --queue default
149149
```
150150

151151
In a second terminal:
152152

153153
```bash
154-
fluxqueue start --tasks-module-path myapp.tasks --queue urgent
154+
fluxqueue start --tasks-module-path myapp/tasks --queue urgent
155155
```
156156

157157
## Alternative: Single File

docs/tutorial/quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ def important_task(data: str):
6767
To process tasks, you need to run a worker. Make sure Redis is running, then start the worker:
6868

6969
```bash
70-
fluxqueue start --tasks-module-path myapp.tasks --queue default
70+
fluxqueue start --tasks-module-path myapp/tasks --queue default
7171
```
7272

73-
The `--tasks-module-path` tells the worker where to find your task functions. It should be the module path where your tasks are defined (e.g., `myapp.tasks` if your tasks are in `myapp/tasks.py`). For more details, see [Defining and Exposing Tasks](defininig_and_exposing_tasks.md).
73+
The `--tasks-module-path` tells the worker where to find your task functions. It should be the module path where your tasks are defined (e.g., `myapp/tasks` if your tasks are in `myapp/tasks.py`). For more details, see [Defining and Exposing Tasks](defininig_and_exposing_tasks.md).
7474

7575
## Complete Example
7676

docs/tutorial/worker.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The worker is a standalone Rust-powered process (invoked through the `fluxqueue`
2727
!!! tip
2828
In development, you will usually run the worker through the dedicated Python CLI (`fluxqueue-cli`), which exposes a Python-friendly interface:
2929
```bash
30-
fluxqueue start --tasks-module-path myapp.tasks --queue default
30+
fluxqueue start --tasks-module-path myapp/tasks --queue default
3131
```
3232

3333
For production, the recommended way is to run the underlying Rust binary `fluxqueue-worker` directly with the same flags. The `fluxqueue` CLI is there to make local development and experimentation nicer.
@@ -39,18 +39,18 @@ The worker is a standalone Rust-powered process (invoked through the `fluxqueue`
3939
Basic usage:
4040

4141
```bash
42-
fluxqueue start --tasks-module-path myapp.tasks --queue default
42+
fluxqueue start --tasks-module-path myapp/tasks --queue default
4343
```
4444

4545
The worker runs in the **foreground**.
4646
If you want multiple workers (for different queues or higher throughput), run each one in its **own terminal**:
4747

4848
```bash
4949
# Terminal 1 – default queue
50-
fluxqueue start --tasks-module-path myapp.tasks --queue default
50+
fluxqueue start --tasks-module-path myapp/tasks --queue default
5151

5252
# Terminal 2 – urgent queue
53-
fluxqueue start --tasks-module-path myapp.tasks --queue urgent
53+
fluxqueue start --tasks-module-path myapp/tasks --queue urgent
5454
```
5555

5656
Press `Ctrl+C` in a worker terminal to trigger **graceful shutdown** (it finishes current work and cleans up executor metadata in Redis).
@@ -95,7 +95,7 @@ Example:
9595
```bash
9696
fluxqueue start \
9797
--redis-url redis://localhost:6379 \
98-
--tasks-module-path myapp.tasks \
98+
--tasks-module-path myapp/tasks \
9999
--queue default
100100
```
101101

@@ -108,7 +108,7 @@ fluxqueue start \
108108

109109
This should be the **module path**, not a file path:
110110

111-
- `myapp.tasks` → imports `myapp/tasks/__init__.py`
111+
- `myapp/tasks` → imports `myapp/tasks/__init__.py`
112112
- `tasks` → imports `tasks.py`
113113

114114
The worker imports that module and inspects it to find callables that have a `task_name` and `queue` attribute (these are normally added by the `@fluxqueue.task()` decorator).
@@ -130,7 +130,7 @@ Use different queues to separate workloads:
130130
Example:
131131

132132
```bash
133-
fluxqueue start --tasks-module-path myapp.tasks --queue urgent
133+
fluxqueue start --tasks-module-path myapp/tasks --queue urgent
134134
```
135135

136136
### `--save-dead-tasks`
@@ -259,11 +259,11 @@ Example (two workers for `default`, one for `urgent`):
259259

260260
```bash
261261
# Machine 1
262-
fluxqueue start --tasks-module-path myapp.tasks --queue default --concurrency 4
262+
fluxqueue start --tasks-module-path myapp/tasks --queue default --concurrency 4
263263

264264
# Machine 2
265-
fluxqueue start --tasks-module-path myapp.tasks --queue default --concurrency 4
266-
fluxqueue start --tasks-module-path myapp.tasks --queue urgent --concurrency 2
265+
fluxqueue start --tasks-module-path myapp/tasks --queue default --concurrency 4
266+
fluxqueue start --tasks-module-path myapp/tasks --queue urgent --concurrency 2
267267
```
268268

269269
---

0 commit comments

Comments
 (0)