Skip to content

Commit 152f058

Browse files
committed
Update docs to match new dapr[ext] structure
Signed-off-by: Sergio Herrera <627709+seherv@users.noreply.github.com>
1 parent 67915a2 commit 152f058

3 files changed

Lines changed: 34 additions & 2 deletions

File tree

dapr/ext/workflow/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Workflow (orchestrator) functions must remain generators (`def` with `yield`). T
122122

123123
**`maximum_thread_pool_workers` covers both paths.** This knob sizes the worker thread pool used for sync-activity bodies and for async-activity gRPC response sends. Mixed workloads with long-running sync activities can starve async response delivery (and vice versa) since they share the pool — size to the sum of peak sync activity concurrency and peak in-flight async response sends.
124124

125-
**Concurrency sizing and load characterization.** See `docs/concurrency.md` for sizing recommendations (`maximum_concurrent_activity_work_items`, `maximum_thread_pool_workers`) and an async-vs-sync decision tree. `tests/durabletask/test_async_dispatch_regression.py` (marked `perf`) guards the core invariant: a batch of async activities overlaps on the event loop instead of serializing through the thread pool.
125+
**Concurrency sizing and load characterization.** See `docs/concurrency.md` for sizing recommendations (`maximum_concurrent_activity_work_items`, `maximum_thread_pool_workers`) and an async-vs-sync decision tree. `tests/ext/workflow/durabletask/test_async_dispatch_regression.py` (marked `perf`) guards the core invariant: a batch of async activities overlaps on the event loop instead of serializing through the thread pool.
126126

127127
**grpc.aio poller log noise.** The async client can emit benign `BlockingIOError: [Errno 11]` ERROR lines from `grpc.aio`'s `PollerCompletionQueue` under load. It is harmless and retried. `get_grpc_aio_channel` installs an internal `asyncio`-logger filter (`_silence_grpc_aio_poller_noise`) that drops only those records, so the SDK suppresses it automatically with no user action.
128128

dapr/ext/workflow/docs/concurrency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Concurrency configuration for `dapr-ext-workflow`
1+
# Concurrency configuration for `dapr.ext.workflow`
22

33
Sizing notes for the worker's concurrency knobs.
44

examples/workflow/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,35 @@ It shows:
559559
```sh
560560
dapr run --app-id workflow-history-propagation -- python3 history_propagation.py
561561
```
562+
563+
### Async Activities
564+
565+
This example fans out several `async def` activities, then aggregates their
566+
results in a sync activity. Each async activity awaits a delay to stand in for
567+
an I/O call, so the instances run concurrently on the worker's event loop
568+
instead of taking a thread each.
569+
570+
Fan-out width and payload sizes are set with environment variables:
571+
`WORKFLOW_FAN_OUT` (default 5), `WORKFLOW_INPUT_BYTES` (default 2048),
572+
`WORKFLOW_OUTPUT_BYTES` (default 1024), and `WORKFLOW_IO_SECONDS` (default 1.0).
573+
574+
See [concurrency.md](../../dapr/ext/workflow/docs/concurrency.md) for when to
575+
prefer async over sync activities and how to size the concurrency knobs.
576+
577+
```sh
578+
dapr run --app-id workflow-async-activities -- python3 async_activities.py
579+
```
580+
581+
The output should look like this (the async lines can arrive in any order):
582+
583+
```
584+
Workflow started. Instance ID: 7b3e9c1f...
585+
[async] payload 0: 2048B in -> 1024B out
586+
[async] payload 1: 2048B in -> 1024B out
587+
[async] payload 2: 2048B in -> 1024B out
588+
[async] payload 3: 2048B in -> 1024B out
589+
[async] payload 4: 2048B in -> 1024B out
590+
[sync] 5 results, 5120 bytes
591+
Workflow completed! Status: COMPLETED
592+
Workflow result: 5 results, 5120 bytes
593+
```

0 commit comments

Comments
 (0)