# Motivation
During the discussion in https://github.com/apple/swift-async-algorithms/issues/248 it became clear that the semantics of `throttle` are not 100% figured out yet.
# Modification
This PR is making `throttle` an underscored API for the upcoming 1.0.0 release. This gives us more time to investigate what exact semantics we want to have.
# Motivation
We added `@_implementationOnly` a little while ago to hide the dependency on the `DequeModule`. However, with recent compilers this produces a warning since `@_implementationOnly` is only intended to be used in resilient libraries.
# Modification
This PR removes the usage of `@_implementationOnly`
# Motivation
`@unchecked Sendable` is a great way to make a type `Sendable` while it is not really `Sendable` this is rarely useful and we should rather use conditional `@unchecked Sendable` annotations such as the one on `ManagedCriticalState`
# Modification
This PR removes all `@unchecked Sendable` in the main algorithm target except the one on `Merge` since we are doing manual locking there.
# Result
No more `@unchecked Sendable` usage.
# Motivation
Currently, the `AsyncTimerSequence` is trying to correct for when an application becomes suspended and the timer might fire multiple times once the application gets foregrounded again.
However, this is already handled by the `Clock` types themselves. The `SuspendingClock` is correcting for suspension of the app whereas the `ContinuousClock` is not.
Additionally, this was not only hit by background an application but by just calling `Task.sleep` in the for-await loop that is consuming the sequence.
# Modification
This removes the part of the code in `AsyncTimerSequence` which corrected for suspension of the application.
# Motivation
We still had some `Sendable` warnings left under strict Concurrency checking.
# Modification
This PR fixes a bunch of `Sendable` warnings but we still have some left in the validation tests. Additionally, I fixed a flaky test.
* Integrate review feedback
This integrates all of the feedback from the review thread. Here is a quick summary:
- Change the trailing separator behaviour. We are no longer returning a separator before we are forwarding the error
- Add a synchronous and asynchronous closure based `interspersed` method.
- Support interspersing every n elements
* Add AsyncThrowingInterspersedSequence
* Update examples
* Clean up old evolution proposals
# Motivation
Our old proposals had a couple of stale links and were not all aligned. This cleans them up.
* Add Interspersed proposal
# Motivation
Add a new evolution proposal for the interspersed algorithm.
# Motivation
Swift 5.8 is including a change to how `group.waitForAll()` is working. It now properly waits for all tasks to finish even if one of the tasks throws. We have used `group.waitForAll()` in multiple places and need to change this code accordingly.
# Modification
Switch code from `group.waitForAll()` to `group.next()`.
# Result
This fixes a few stuck tests that we have seen when running against development snapshots.
# Motivation
We switched the point in time when we create tasks to the first call to `next()`. This had the side effect that we can now be cancelled before we even created our task. Which by itself is fine but we didn't handle it in the state machines.
# Modification
Adapt the state machines of `debounce`, `zip`, `merge` and `combineLatest` to handle cancellation before `next()`.
# Result
We shouldn't run into these preconditions anymore.
While in the current configuration lock/unlock shouldn't ever fail,
it seems polite to guard against basic misuse in debug builds.
Co-authored-by: Dan Appel <dan_appel@apple.com>
# Motivation
This follows the recent rework of the `merge` and `zip` algorithms where we dropped the `Sendable` constraint on the `BaseX.AsyncIterator`. This PR now removes the same constraint on `combineLatest`.
# Modification
This PR overhauls the implementation of `combineLatest` with the goal of changing these things:
- Drop the `Sendable` constraint of the base `AsyncIterator`s
- Only create a single `Task`
# Result
`combineLatest` now doesn't require the base `AsyncIterator` to be `Sendable`
# Motivation
I raise on the pitch of `AsyncBufferedByteIterator` on the forums that I think the iterator must not be `Sendable`. The reasoning for this is twofold. First, an iterator is the connection of a consumer to the `AsyncSequence`; therefore, iterators should not be shared since it breaks that assumption. Secondly, the implementation of the `AsyncBufferedByteIterator` can be more straight forward since we don't have to check for unique ownership of the storage.
# Modification
Remove the `Sendable` conformances from `AsyncBufferedByteIterator`.
# Motivation
We recently merged https://github.com/apple/swift-async-algorithms/pull/201 which removed the `Sendable` constraint of the `AsyncIterator` from `zip`. There were some left over comments that we wanted to fix in a follow up. Furthermore, we also can merge the implementations of `zip2` and `zip3` relatively easily. The merging also aids us in understanding what we need from the variadic generics proposals and allows us to give feedback since `zip` is non-trivial to implement with variadic generics.
Lastly, the merged state machine will be a good base for the overhaul of `combineLatest`.
# Modification
This PR merges the state machines from `zip2` and `zip3` into a single one. Furthermore, it addresses some of the open feedback from the last PR.
# Result
We now have a single state machine which is a good foundation for our changes to `combineLatest`.
# Motivation
We have been discussing this a lot in the other PRs, but in general said that an `AsyncIterator` is the connection between the consuming task and the `AsyncSequence`. If an `AsyncIterator` would be `Sendable` then we don't have that relationship anymore. Therefore, no iterator of an `AsyncIterator` should be `Sendable`.
# Modification
Remove all `Sendable` conformances of the iterators even the conditional ones. We can always add them back later.
# Motivation
We want to remove any `Sendable` constraints on iterators since they ought to not be passed between `Task`s.
# Modification
Explicitly mark the `AsyncChain2Sequence` to be not `Sendable`.
# Result
Nobody can make this `Sendable`.
# Motivation
We want to remove any `Sendable` constraints on iterators since they ought to not be passed between `Task`s.
# Modification
Explicitly mark the `AsyncAdjacentPairsSequence` to be not `Sendable`.
# Result
Nobody can make this `Sendable`.