swift-async-algorithms
swift-async-algorithms copied to clipboard
Async Algorithms for Swift
This PR aims to: - harmonize the cancellation handling for the `next()` and `send()` operations. Previously, a `send()` cancellation was terminating all the pending and awaiting operations, which seemed wrong...
# Motivation Currently a lot of the operator implementations in here that consume other `AsyncSequence`s require the `AsyncIterator` to be `Sendable`. This is mostly due to the fact that we...
This proposal introduces the lazy accessors of `.async` to convert existing `Sequence` types to `AsyncSequence` types. Read the full proposal [here](https://raw.githubusercontent.com/phausler/swift-async-algorithms/pr/lazy_proposal/Evolution/NNNN-lazy.md)
This proposal introduces the chain algorithm. Read the full proposal [here](https://github.com/phausler/swift-async-algorithms/blob/pr/chain_proposal/Evolution/NNNN-chain.md).
This proposal introduces the `AsyncBufferedByteIterator` type; usable for making highly performant byte wise iteration. Read the full proposal [here](https://github.com/phausler/swift-async-algorithms/blob/pr/bytes_proposal/Evolution/NNNN-bytes.md).
The original expectations features in XCTests are not fully compatible with iOS. The tests for AsyncChannel pass with macOS but not iOS. This PR includes a new type called AsyncExpectation...
Hi @phausler I was wondering if the task cancellation when sending an element in an AsyncChannel was not a bit too violent ? This is the code when sending an...
`Task.select` waits for the first task of a sequence to complete and then returns this task. If the sequence is empty, then this operation waits indefinitely: https://github.com/apple/swift-async-algorithms/blob/f44d02eb26f79d43215d0952b6e8cddc9c369baa/Sources/AsyncAlgorithms/TaskSelect.swift#L47-L63 In this `withUnsafeContinuation`...
This redirects rendered docs into the documentation category.
We need a way to imperatively pipe events into a AsyncSequence same asi Subjects from Combine did, or Kotlin's MutableState/SharedFlow AsynchChannel feels like a low level primitive to be used...