Skip to content

Conversation

@czechboy0
Copy link

@czechboy0 czechboy0 commented Aug 14, 2025

This is a draft PR to gather early feedback.

It introduces a combineLatestMany algorithm, inspired by the combineLatest variants, but dynamic across the input async sequences (both number and types), with only the element and failure types needing to match between them.

(Thanks to @FranzBusch for helping me figure out a few blockers along the way 🙏)

Please advise on the naming and next steps, thanks.

@czechboy0
Copy link
Author

Hey @phausler, is this an algorithm that you'd accept here? If so I can write up a proposal

czechboy0 added a commit to apple/swift-configuration that referenced this pull request Nov 4, 2025
### Motivation

- Fixes #17
- Fixes #23
- Fixes #32
- Fixes #43
- Fixes #44

These 5 fixes are intertwined and were difficult to split out, so here's
one PR that fixes them all.

### Modifications

- The PR enables NonisolatedNonsendingByDefault, which caused an error
in the existing combineLatest implementation, which we wanted to replace
anyway.
- So we vendor in the code from Swift Async Algoritms (the PR is open
here: apple/swift-async-algorithms#360), the
plan is to remove this copy when it lands in async algos.
- Updating the combineLatest implementation to the correct one requires
the async sequences to be Sendable, which in turn requires Swift 6.2 for
us to be able to spell `any (AsyncSequence & Sendable)` correctly, it
doesn't work on 6.1.
- We also enabled the explicit sendable warning in CI, helping us ensure
all our public API is explicitly annotated as Sendable or not.

### Result

Addressed 5 important issues that impact the API and concurrency.

### Test Plan

Brought over tests for the new combineLatest implementation, added more
unit tests for failure cases when using the ConfigReader with multiple
providers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CombineLatest for an array of upstreams

2 participants