Skip to content

Commit 7a56f98

Browse files
committed
docs
1 parent e6ed229 commit 7a56f98

2 files changed

Lines changed: 32 additions & 12 deletions

File tree

WORKER_CONFIGURATION.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ This means:
1919

2020
The following properties can be configured via environment variables:
2121

22-
| Property | Type | Description | Example |
23-
|----------|------|-------------|---------|
24-
| `poll_interval` | float | Polling interval in milliseconds | `1000` |
25-
| `domain` | string | Worker domain for task routing | `production` |
26-
| `worker_id` | string | Unique worker identifier | `worker-1` |
27-
| `thread_count` | int | Number of concurrent threads/coroutines | `10` |
28-
| `register_task_def` | bool | Auto-register task definition | `true` |
29-
| `poll_timeout` | int | Poll request timeout in milliseconds | `100` |
30-
| `lease_extend_enabled` | bool | Enable automatic lease extension | `true` |
31-
| `paused` | bool | Pause worker from polling/executing tasks | `true` |
22+
| Property | Type | Description | Example | Decorator? |
23+
|----------|------|-------------|---------|------------|
24+
| `poll_interval` | float | Polling interval in milliseconds | `1000` | ✅ Yes |
25+
| `domain` | string | Worker domain for task routing | `production` | ✅ Yes |
26+
| `worker_id` | string | Unique worker identifier | `worker-1` | ✅ Yes |
27+
| `thread_count` | int | Number of concurrent threads/coroutines | `10` | ✅ Yes |
28+
| `register_task_def` | bool | Auto-register task definition | `true` | ✅ Yes |
29+
| `poll_timeout` | int | Poll request timeout in milliseconds | `100` | ✅ Yes |
30+
| `lease_extend_enabled` | bool | Enable automatic lease extension | `false` | ✅ Yes |
31+
| `paused` | bool | Pause worker from polling/executing tasks | `true` |**Environment-only** |
32+
33+
**Note**: The `paused` property is intentionally **not available** in the `@worker_task` decorator. It can only be controlled via environment variables, allowing operators to pause/resume workers at runtime without code changes or redeployment.
3234

3335
## Environment Variable Format
3436

@@ -356,7 +358,7 @@ Use sensible defaults in code so workers work without environment variables:
356358
poll_interval=1000, # Reasonable default
357359
domain='dev', # Safe default domain
358360
thread_count=5, # Moderate concurrency
359-
lease_extend_enabled=True # Safe default
361+
lease_extend_enabled=False # Default: disabled
360362
)
361363
def process_order(order_id: str):
362364
...

WORKER_DESIGN.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ async def notify(message: str):
144144
| `domain` | str | None | Worker domain |
145145
| `worker_id` | str | auto | Worker identifier |
146146
| `poll_timeout` | int | 100 | Poll timeout (ms) |
147-
| `lease_extend_enabled` | bool | True | Auto-extend lease |
147+
| `lease_extend_enabled` | bool | False | Auto-extend lease |
148148
| `register_task_def` | bool | False | Auto-register task |
149149

150150
### Examples
@@ -172,6 +172,24 @@ export conductor.worker.process_order.thread_count=50
172172

173173
**Result:** `domain=production`, `thread_count=50`
174174

175+
### Startup Configuration Logging
176+
177+
When workers start, they log their resolved configuration in a compact single-line format:
178+
179+
```
180+
INFO - Conductor Worker[name=process_order, status=active, poll_interval=1000ms, domain=production, thread_count=50, poll_timeout=100ms, lease_extend=false]
181+
```
182+
183+
This shows:
184+
- Worker name and status (active/paused)
185+
- All resolved configuration values
186+
- Configuration source (code, global env, or worker-specific env)
187+
188+
**Benefits:**
189+
- Quick verification of configuration in logs
190+
- Easy debugging of environment variable issues
191+
- Single-line format for log aggregation tools
192+
175193
---
176194

177195
## Worker Discovery

0 commit comments

Comments
 (0)