Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f1bc995
Basic setup to compile below iOS 18.0 and similar
stefanomondino Sep 22, 2025
5b4092d
Update Sources/AsyncAlgorithms/AsyncShareSequence.swift
stefanomondino Oct 7, 2025
5b1655e
Update Sources/AsyncAlgorithms/AsyncShareSequence.swift
stefanomondino Oct 7, 2025
59e6f1c
Update Sources/AsyncAlgorithms/AsyncShareSequence.swift
stefanomondino Oct 7, 2025
180c686
Update Sources/AsyncAlgorithms/AsyncShareSequence.swift
stefanomondino Oct 7, 2025
d6d2106
Update Sources/AsyncAlgorithms/AsyncShareSequence.swift
stefanomondino Oct 7, 2025
e82edc1
fix: crash on <ios 18
stefanomondino Oct 7, 2025
bb65a71
Update Sources/AsyncAlgorithms/AsyncShareSequence.swift
stefanomondino Oct 7, 2025
025874d
fix: indentation issues
stefanomondino Oct 7, 2025
08ba126
fix: restore generic Failure
stefanomondino Oct 11, 2025
6f29167
- enable 1.2 and change 1.1 with backwards compatibility to iOS 16
stefanomondino Oct 11, 2025
657a391
fix: crash on pre 1.2
stefanomondino Oct 15, 2025
a86673d
refactor 1.1 to go back until ios 14.0 and similar
stefanomondino Oct 15, 2025
25a9962
Update Tests/AsyncAlgorithmsTests/TestShare.swift
stefanomondino Oct 15, 2025
ae88be1
fix copyrights, remove typos, change sleep to a custom shorthand back…
stefanomondino Oct 16, 2025
010546a
remove requirement for swift 6.2 - backwards compatibility down to 5.8
stefanomondino Oct 30, 2025
b8c7e16
remove compiler constraint from tests
stefanomondino Oct 30, 2025
2acec08
fix: remove failing XCTSkip
stefanomondino Dec 10, 2025
056ca11
fix: update new operators to 1.2
stefanomondino Dec 10, 2025
f2e75f0
feat: restore old share operator and create a new "legacy" one
stefanomondino Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import CompilerPluginSupport
let AsyncAlgorithms_v1_0 = "AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0"
#if compiler(>=6.0) && swift(>=6.0) // 5.10 doesnt support visionOS availability
let AsyncAlgorithms_v1_1 =
"AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"
"AvailabilityMacro=AsyncAlgorithms 1.1:macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, visionOS 1.0"
let AsyncAlgorithms_v1_2 =
"AvailabilityMacro=AsyncAlgorithms 1.2:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"
#else
let AsyncAlgorithms_v1_1 = "AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0"
let AsyncAlgorithms_v1_1 = "AvailabilityMacro=AsyncAlgorithms 1.1:macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0"
let AsyncAlgorithms_v1_2 =
"AvailabilityMacro=AsyncAlgorithms 1.2:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0"
#endif

let availabilityMacros: [SwiftSetting] = [
Expand All @@ -18,6 +22,9 @@ let availabilityMacros: [SwiftSetting] = [
.enableExperimentalFeature(
AsyncAlgorithms_v1_1
),
.enableExperimentalFeature(
AsyncAlgorithms_v1_2
)
]

let package = Package(
Expand Down
5 changes: 4 additions & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ let availabilityMacros: [SwiftSetting] = [
"AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0"
),
.enableExperimentalFeature(
"AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"
"AvailabilityMacro=AsyncAlgorithms 1.1:macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, visionOS 1.0"
),
.enableExperimentalFeature(
"AvailabilityMacro=AsyncAlgorithms 1.2:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"
),
]

Expand Down
6 changes: 3 additions & 3 deletions Sources/AsyncAlgorithms/AsyncShareSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import Synchronization
import DequeModule

@available(AsyncAlgorithms 1.1, *)
@available(AsyncAlgorithms 1.2, *)
extension AsyncSequence
where Element: Sendable, Self: SendableMetatype, AsyncIterator: SendableMetatype {
/// Creates a shared async sequence that allows multiple concurrent iterations over a single source.
Expand Down Expand Up @@ -114,7 +114,7 @@ where Element: Sendable, Self: SendableMetatype, AsyncIterator: SendableMetatype
//
// This type is typically not used directly; instead, use the `share()` method on any
// async sequence that meets the sendability requirements.
@available(AsyncAlgorithms 1.1, *)
@available(AsyncAlgorithms 1.2, *)
struct AsyncShareSequence<Base: AsyncSequence>: Sendable
where Base.Element: Sendable, Base: SendableMetatype, Base.AsyncIterator: SendableMetatype {
// Represents a single consumer's connection to the shared sequence.
Expand Down Expand Up @@ -697,7 +697,7 @@ where Base.Element: Sendable, Base: SendableMetatype, Base.AsyncIterator: Sendab
}
}

@available(AsyncAlgorithms 1.1, *)
@available(AsyncAlgorithms 1.2, *)
extension AsyncShareSequence: AsyncSequence {
typealias Element = Base.Element
typealias Failure = Base.Failure
Expand Down
Loading