Skip to content

[Context]: add ProcessStream for IAsyncEnumerable #25

Description

@rian-be

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    concurrencyParallel / batch / async executionenhancementNew feature or requestextensionExtension behaviors / helpers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions