The `#else` branch declared `AsyncAlgorithms_v1_3` with the macro name
`AsyncAlgorithms 1.2`, so that branch defined `AsyncAlgorithms 1.2` twice
and never defined `AsyncAlgorithms 1.3`.
Issue: https://github.com/apple/swift-async-algorithms/issues/452
- NNNN-async-streaming.md is intentionally kept alongside the AsyncStreaming
implementation
- Exclude it from the target in Package.swift so SwiftPM no
longer reports it as an unhandled file (#433)
* [AsyncStreaming] Introduce a `MultiProducerSingleConsumerChannel` and a duplex
* Add tests
* Fix UnstableAsyncStreaming test build
---------
Co-authored-by: Franz Busch <f.busch@apple.com>
This PR adds an experimental module for asynchronous streaming interfaces as a potential evolution to async sequence. These APIs are considered highly unstable and are mostly for experimentation purposes; hence, they are part of an underscored module and all APIs are hidden behind a trait. I expect significant changes to those APIs to offer more functionality such as gather scatter and more.
* rename the map error proposal to have a specific number
* rename the flatMapLatest proposal to have a specific numbering
* Update availability markers for flatmapLatest
* Cleanup formatting pass for FlatMapLatest
* Remove stray extra single quote
* Add a fallback for older versions of swift for the next method on flatMapLatest
* Add partial support for FreeBSD
This change will allow `swift build` to succeed. However, SwiftPM support is still incomplete and does not yet allow adding `.freebsd` to `.when(platforms:)`, so `swift test` cannot be executed.
* Make `swift test` work on FreeBSD
* Implement AsyncMapErrorSequence
* Update the proposal, implementation and tests with formatting, additional details and modifications for being able to push it to a review
* Foratting and preambles
* Update Copyright date for error sequence
Co-authored-by: Clive <clive819@users.noreply.github.com>
* Update copyright year for mapError tests
Co-authored-by: Clive <clive819@users.noreply.github.com>
* Update availablity and modify the mapError algorithm to be opaque
* Correct pre 6.0 build avail parameters
* Make the formatting of the algorithm accesor a bit more consistent
* Update the 5.8 package builder to define 1.2
* re-run formatter
---------
Co-authored-by: Clive <clive819@gmail.com>
Co-authored-by: Clive <clive819@users.noreply.github.com>
This is an implementation of share; an algorithm for allowing AsyncSequence types to be iterated by multiple consumers. In addition this cleans up the project to be a starting point for the 1.1 release - it fixes the continuous integration support and configurations but has the cost of only supporting 3 active releases (6.0, 6.1, and 6.2). Previous releases are only going to have legacy support via older released versions.
* Fix the remaining todo on hard cancellation vs soft cancellation
* Update Sources/AsyncAlgorithms/AsyncShareSequence.swift
Co-authored-by: Jamie <2119834+jamieQ@users.noreply.github.com>
* Update the implementation of share to handle sendability requirements, address some edge cases and update to the latest version of the discussion around buffering behaviors as well as adding some documentation and commentary
* Add some first drafts at unit tests for verifying share behaviors
* Cleanup some of the documentation and address feedback for implementation details
* Fix merge damage by restoring the changes from @jamieQ
* Fix up some availability issues w.r.t. sendable metatypes
* Add a preamble to SendableMetatypes.swift
* Add a fallback for next (for pre 6.2 swift's)
* Slight adjustments for older compiler builds and expose the sendable metatypes since those are part of documentation
* Update formatting and gate availability for older compilers
* Speculative fix for pre 6.1 compiler crashes by removing the sending keyword
* Revert "Speculative fix for pre 6.1 compiler crashes by removing the sending keyword"
This reverts commit 875fa81bc6.
* Speculative fix for pre 6.1 compiler crashes by removing the sending keyword, and correct sendable metatype shim availability
* Remove block comment for formatting check
* Take a more conservative approach and roll back to only supporting share on 6.2
* Only test share on 6.2 or newer
* roll back to older sendable metatype constraints
* yet another stab at 5.10 visionOS guards
* Formatting pass
* Disable 5.10 builds and leave those to older releases
* Ignore swift-version files to avoid local swiftly toolchain selection from being required by others
* Renumber the proposals and copy share into a guide
* Add a link from the primary doc interface to share
---------
Co-authored-by: Jamie <2119834+jamieQ@users.noreply.github.com>
* Conditionalize the testing targets for non-windows targets to avoid the TaskDriver requirements
* Some driveby formatting fixes and remove the freebsd target since that is not supported in swiftpm yet
* Rework validation import conditions to dependency conditionals
* Exclude 5.9 workflows and enable macOS testing scheme for CI
* Additional ifdefing out non windows targets for sequence diagram testing and more formatting fixes
* Correct build failures while updating to 6.2 swift build modes
* Add a package definition for 5.8 builds
* Add some brief explanation for the alteration of the Element in the buffer to an UnsafeTransfer
* Fix broken merge for wasi threads
When DocC was introduced the DocC plugin was useful for building documentation locally. Nowadays both Xcode and VSCode have built-in support to generate this without the need for the plugin.
This PR removes the direct dependency on the plugin.
* Move platform requirements to availability annotations
Adding or raising the deployment platforms in the package manifest is a
SemVer major breaking change as consumers must also add or raise their
deployment platforms. This is a known limitation of SwiftPM.
Unforunately this means that it's very difficult for non-leaf packages
to adopt packages which declare their platforms in the manifest. Doing
so puts the brakes on adoption and ecosystem growth. For 'core' packages
like this one availability constraints should be expressed on
declarations rather than in the manifest.
This patch adds equivalent availability annotations to declarations
across the package and removes platforms from the package manifest.
* Address naming feedback
* Only depend on OrderedCollections from swift-collections
Before this change, once consumers update to SwiftCollections 1.1.0 they'll pull in all of the new collection dependencies (HashTree, BitCollections, etc.). In our case, this increased our binary size by ~1MB. To fix this, we switch to only depending on what we need.
* Add DequeModule dependency
# Motivation
We had some scripts around to generate docs for this package but all of our other packages are now providing documentation on the Swift package index.
# Modification
This removes the old script to generate documentation and adds an `.spi.yml` file. Furthermore, I removed the conditional dependency on the docc plugin which we are unconditionally depending on in most of our other packages like NIO.
# Motivation
The current validation testing library has a bunch of warnings and we haven't put it through a proper API review yet. Since we are preparing for a 1.0.0, I think it is best if we remove the products for the validation targets for now and take some time to make sure the interfaces are taken through an API review.
# Modification
Remove products for the validation targets.
# 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.
* asyncChannel: introduce ChannelToken to model Pending and Awaiting
* asyncChannel: harmonize send and next cancellation
* asyncChannel: add .finished as an emission state
* asyncThrowingChannel: harmonize send and next cancellation
* channel: update documentation for cancellation
* Remove the disable of availability and mark methods as available to clock/instant/duration
* Rework availability to be more permissive for tests
* Use hand coded values instead of defines (only available via Darwin versions of Dispatch)
* Adjust additional test availability
* Correct debounce test availability guard
* Update build instructions to indicate Xcode requirements
* Ensure the clock property of the validation diagram is only available for targets that can support it
* Implement source location information for pairwise block builders
* Enable better source locations for latest validation diagrams
* Use the new naming for partial builders
* Ensure pairwise builder expressions preserve source locations
* Add a detailed proposal like guide for MarbleDiagram
* Slight spacing change
Co-authored-by: kperryua <kperry@apple.com>
* Fix some pluralization agreement
Co-authored-by: kperryua <kperry@apple.com>
* Clarify the testing of merge and add a future direction for unordered groups
* rename the diagram system to a more general 'validate' based name
* Spelling fixes
* Grammar fixes for credits
Co-authored-by: kperryua <kperry@apple.com>
* Split the marble diagram code out into their own files for easier refactoring
* Update latest landing InstantProtocol definition stub
* Migrate to a per Task based queue system to avoid blocking valid future jobs
* Factor inputs to be specialized waits for side tracking
* Add grouping support
* Add tests for grouping and parse failures
* Fixup misstep in package definition for clock stub imports for the marable diagrams
* Add descriptions for partial iterations for debugging aides
* Simplify Task.select implementation to handle continuations more encapsulatedly
* Add descriptions for WorkQueue items for debugging and use stable work queue drains
* Rework marble diagrams to account for task execution
* Add marble diagram tests to validate failure paths
* Test for space no-op in marable diagram DSL
* Factor out parsing into events and generalize
* Add an algorithm to obtain the first result of a list of tasks
* A much simpler and less risky implementation of Task.first that supports cancellation propigation
* Slight whitespace fix for Package.swift
* Demote Task.first to internal - revisit for better naming later as public
* Add a package layout and initial implementation and tests for AsyncLazySequence; a type for converting non asynchronous sequences into asynchronous ones
* Add a first iteration pass expectation to ensure that tasks spawn for testing cancellation of AsyncLazySequence
* Simplify the iterator for AsyncLazySequence