Summary
Add ProcessStream — support for IAsyncEnumerable sources so items are processed as they arrive.
Goal
Let context-scoped work consume and process async streams item-by-item as data flows in, rather than after materializing a full collection.
Problem
Current batch primitives take IEnumerable<T>. For unbounded/live sources (queue, paginated endpoints), callers must materialize entire collections first, hurting latency and memory.
Example
await foreach (var item in manager.ProcessStream(ctx, GetItemsAsync()))
{
await Process(item);
}
Considerations
IAsyncEnumerable processing stream.
- Ordering implications under streaming (pair with Ordered/Unordered).
- Cancellation propagates through the stream.
- Per-item context isolation preserved.
Non-Goals
- Not bounded by concurrency here unless composed with Map/MaxConcurrency.
Summary
Add
ProcessStream— support forIAsyncEnumerablesources so items are processed as they arrive.Goal
Let context-scoped work consume and process async streams item-by-item as data flows in, rather than after materializing a full collection.
Problem
Current batch primitives take
IEnumerable<T>. For unbounded/live sources (queue, paginated endpoints), callers must materialize entire collections first, hurting latency and memory.Example
Considerations
IAsyncEnumerableprocessing stream.Non-Goals