Skip to content

Comments

[Repo Assist] Add AsyncSeq.mapAsyncUnorderedParallelThrottled#225

Merged
dsyme merged 4 commits intomainfrom
repo-assist/add-mapasyncunorderedparallelthrottled-001ed43df569b4c9
Feb 21, 2026
Merged

[Repo Assist] Add AsyncSeq.mapAsyncUnorderedParallelThrottled#225
dsyme merged 4 commits intomainfrom
repo-assist/add-mapasyncunorderedparallelthrottled-001ed43df569b4c9

Conversation

@github-actions
Copy link
Contributor

🤖 Repo Assist here — I'm an automated AI assistant for this repository.

Closes #31

Summary

Adds AsyncSeq.mapAsyncUnorderedParallelThrottled, a new function that maps an async function over an AsyncSeq in parallel with:

  • Unordered emission: results are emitted as soon as they complete, not in source order
  • Throttled concurrency: at most parallelism operations run concurrently (via SemaphoreSlim)

This directly addresses issue #31 (requested in 2015) and fills the gap between:

  • mapAsyncUnorderedParallel (unordered but unbounded parallelism)
  • iterAsyncParallelThrottled (throttled but no results returned)

Implementation

The implementation directly combines the established patterns from mapAsyncUnorderedParallel and iterAsyncParallelThrottled. No new dependencies or abstractions were introduced.

// Signature (in .fsi)
val mapAsyncUnorderedParallelThrottled : parallelism:int -> mapping:('T -> Async<'U>) -> s:AsyncSeq<'T> -> AsyncSeq<'U>

Example use case (from #31):

let downloadAll parallelCount =
    jobs
    |> AsyncSeq.mapAsyncUnorderedParallelThrottled parallelCount download

Test Status

  • Build: could not be verified locally — NuGet package restore is blocked by the environment firewall (same infrastructure limitation as previous Repo Assist PRs). The CI pipeline has full NuGet access and will verify build correctness.
  • Tests: could not run locally for the same reason. Previous pattern-equivalent functions (mapAsyncUnorderedParallel, iterAsyncParallelThrottled) are tested; this function follows identical logic.

Generated by Repo Assist

To install this workflow, run gh aw add githubnext/agentics/workflows/repo-assist.md@6c79ed2cf36b9cfa0f5b499d00a0afc4a5d8f0c0. View source at https://github.com/githubnext/agentics/tree/6c79ed2cf36b9cfa0f5b499d00a0afc4a5d8f0c0/workflows/repo-assist.md.

Warning

⚠️ Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • api.nuget.org
  • dc.services.visualstudio.com

Adds a new function that applies an async mapping in parallel (unordered
results) while limiting concurrency to a specified number of tasks.

Combines the patterns from mapAsyncUnorderedParallel (unordered emission)
and iterAsyncParallelThrottled (SemaphoreSlim-based throttling).

Closes #31

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme
Copy link
Contributor

dsyme commented Feb 21, 2026

Updated network access for Repo Assist, should be able to restore and test now

@dsyme dsyme marked this pull request as ready for review February 21, 2026 14:32
@dsyme
Copy link
Contributor

dsyme commented Feb 21, 2026

Needs tests and testing

Tests cover:
- All results are produced (correctness)
- Handler exceptions propagate
- Concurrency is throttled to the specified parallelism

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme merged commit 3e7629c into main Feb 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant