Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 11 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ jobs:
ruby-version: '3.3.5'
bundler-cache: true
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_26.1.1.app/Contents/Developer
- name: Download visionOS
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- name: Lint Podspec
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=6.0
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=6.2
spm-16:
name: Build Xcode 16
name: Build Xcode 26
runs-on: macos-15
strategy:
matrix:
platforms: [
'iOS_18,watchOS_11',
'macOS_15,tvOS_18',
'macOS_26,tvOS_18',
'visionOS_2'
]
fail-fast: false
Expand All @@ -53,7 +53,7 @@ jobs:
ruby-version: '3.3.5'
bundler-cache: true
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_26.1.1.app/Contents/Developer
- name: Download visionOS
if: matrix.platforms == 'visionOS_2'
run: |
Expand All @@ -72,7 +72,7 @@ jobs:
fail_ci_if_error: true
verbose: true
spm-16-swift:
name: Swift Build Xcode 16
name: Swift Build Xcode 26
runs-on: macos-15
permissions:
contents: read
Expand All @@ -84,37 +84,13 @@ jobs:
ruby-version: '3.3.5'
bundler-cache: true
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_26.1.1.app/Contents/Developer
- name: Build and Test Framework
run: xcrun swift test -c release -Xswiftc -enable-testing
linux-6-0:
name: "Build and Test on Linux Swift 6.0"
linux-6-2:
name: "Build and Test on Linux Swift 6.2"
runs-on: ubuntu-24.04
container: swift:6.0
permissions:
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v5
- name: Build and Test Framework
run: swift test -c release --enable-code-coverage -Xswiftc -enable-testing
- name: Prepare Coverage Reports
run: |
llvm-cov export -format="lcov" .build/x86_64-unknown-linux-gnu/release/swift-async-queuePackageTests.xctest -instr-profile .build/x86_64-unknown-linux-gnu/release/codecov/default.profdata > coverage.lcov
- name: Install curl for Codecov
run: |
apt-get update
apt-get install -y --no-install-recommends curl ca-certificates
- name: Upload Coverage Reports
if: success()
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
verbose: true
linux-6-1:
name: "Build and Test on Linux Swift 6.1"
runs-on: ubuntu-24.04
container: swift:6.1
container: swift:6.2
permissions:
contents: read
steps:
Expand Down Expand Up @@ -148,7 +124,7 @@ jobs:
lint-swift:
name: Lint Swift
runs-on: ubuntu-latest
container: swift:6.0
container: swift:6.2
permissions:
contents: read
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_26.1.1.app/Contents/Developer

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
5 changes: 4 additions & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# format options
--indent tab
--tab-width 4
--smart-tabs disabled
--modifierorder nonisolated,open,public,internal,fileprivate,private,private(set),final,override,required,convenience
--ranges no-space
--extensionacl on-declarations
Expand All @@ -8,6 +10,7 @@
--storedvarattrs same-line
--hexgrouping none
--decimalgrouping 3
--trailing-commas always

# rules
--enable isEmpty
Expand All @@ -17,4 +20,4 @@
--disable blankLineAfterSwitchCase

# global
--swiftversion 6.0
--swiftversion 6.2
4 changes: 2 additions & 2 deletions AsyncQueue.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.name = 'AsyncQueue'
s.version = '0.7.2'
s.version = '1.0.0'
s.license = 'MIT'
s.summary = 'A queue that enables ordered sending of events from synchronous to asynchronous code.'
s.homepage = 'https://github.com/dfed/swift-async-queue'
s.authors = 'Dan Federman'
s.source = { :git => 'https://github.com/dfed/swift-async-queue.git', :tag => s.version }
s.swift_version = '6.0'
s.swift_version = '6.2'
s.source_files = 'Sources/**/*.{swift}'
s.ios.deployment_target = '13.0'
s.tvos.deployment_target = '13.0'
Expand Down
6 changes: 3 additions & 3 deletions CLI/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions CLI/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 6.0
// swift-tools-version: 6.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -12,5 +12,5 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.56.1"),
],
targets: []
targets: [],
)
12 changes: 7 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 6.0
// swift-tools-version: 6.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -16,7 +16,7 @@ let package = Package(
products: [
.library(
name: "AsyncQueue",
targets: ["AsyncQueue"]
targets: ["AsyncQueue"],
),
],
targets: [
Expand All @@ -25,14 +25,16 @@ let package = Package(
dependencies: [],
swiftSettings: [
.swiftLanguageMode(.v6),
]
.treatAllWarnings(as: .error),
],
),
.testTarget(
name: "AsyncQueueTests",
dependencies: ["AsyncQueue"],
swiftSettings: [
.swiftLanguageMode(.v6),
]
.treatAllWarnings(as: .error),
],
),
]
],
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ To install swift-async-queue in your project with [Swift Package Manager](https:

```swift
dependencies: [
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.7.0"),
.package(url: "https://github.com/dfed/swift-async-queue", from: "1.0.0"),
]
```

Expand All @@ -250,7 +250,7 @@ dependencies: [
To install swift-async-queue in your project with [CocoaPods](https://blog.cocoapods.org/CocoaPods-Specs-Repo), add the following to your `Podfile`:

```
pod 'AsyncQueue', '~> 0.7.0'
pod 'AsyncQueue', '~> 1.0.0'
```

## Contributing
Expand Down
12 changes: 6 additions & 6 deletions Scripts/build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum TaskError: Error {
enum Platform: String, CaseIterable, CustomStringConvertible {
case iOS_18
case tvOS_18
case macOS_15
case macOS_26
case macCatalyst_15
case watchOS_11
case visionOS_2
Expand All @@ -36,8 +36,8 @@ enum Platform: String, CaseIterable, CustomStringConvertible {
case .tvOS_18:
"platform=tvOS Simulator,OS=18.5,name=Apple TV"

case .macOS_15,
.macCatalyst_15:
case .macOS_26,
.macCatalyst_15:
"platform=OS X"

case .watchOS_11:
Expand All @@ -56,9 +56,9 @@ enum Platform: String, CaseIterable, CustomStringConvertible {
case .tvOS_18:
"appletvsimulator"

case .macOS_15,
.macCatalyst_15:
"macosx15.5"
case .macOS_26,
.macCatalyst_15:
"macosx26.1"

case .watchOS_11:
"watchsimulator"
Expand Down
26 changes: 13 additions & 13 deletions Sources/AsyncQueue/ActorQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public final class ActorQueue<ActorType: Actor>: @unchecked Sendable {
fileprivate struct ActorTask: Sendable {
init(
executionContext: ActorType,
task: @escaping @Sendable (isolated ActorType) async -> Void
task: @escaping @Sendable (isolated ActorType) async -> Void,
) {
self.executionContext = executionContext
self.task = task
Expand Down Expand Up @@ -152,7 +152,7 @@ extension Task {
public init<ActorType: Actor>(
priority: TaskPriority? = nil,
on actorQueue: ActorQueue<ActorType>,
operation: @Sendable @escaping (isolated ActorType) async -> Success
operation: @Sendable @escaping (isolated ActorType) async -> Success,
) where Failure == Never {
let delivery = Delivery<Success, Failure>()
let semaphore = Semaphore()
Expand All @@ -163,7 +163,7 @@ extension Task {
delivery.execute({ @Sendable executionContext in
await delivery.sendValue(operation(executionContext))
}, in: executionContext, priority: priority)
}
},
)
actorQueue.taskStreamContinuation.yield(task)
self.init(priority: priority) {
Expand All @@ -172,7 +172,7 @@ extension Task {
await semaphore.signal()
return await delivery.getValue()
},
onCancel: delivery.cancel
onCancel: delivery.cancel,
)
}
}
Expand Down Expand Up @@ -207,7 +207,7 @@ extension Task {
public init<ActorType: Actor>(
priority: TaskPriority? = nil,
on actorQueue: ActorQueue<ActorType>,
operation: @escaping @Sendable (isolated ActorType) async throws -> Success
operation: @escaping @Sendable (isolated ActorType) async throws -> Success,
) where Failure == any Error {
let delivery = Delivery<Success, Failure>()
let semaphore = Semaphore()
Expand All @@ -222,7 +222,7 @@ extension Task {
await delivery.sendFailure(error)
}
}, in: executionContext, priority: priority)
}
},
)
actorQueue.taskStreamContinuation.yield(task)
self.init(priority: priority) {
Expand All @@ -231,7 +231,7 @@ extension Task {
await semaphore.signal()
return try await delivery.getValue()
},
onCancel: delivery.cancel
onCancel: delivery.cancel,
)
}
}
Expand Down Expand Up @@ -266,7 +266,7 @@ extension Task {
public init(
priority: TaskPriority? = nil,
on actorQueue: ActorQueue<MainActor>,
operation: @MainActor @escaping () async -> Success
operation: @MainActor @escaping () async -> Success,
) where Failure == Never {
let delivery = Delivery<Success, Failure>()
let semaphore = Semaphore()
Expand All @@ -277,7 +277,7 @@ extension Task {
delivery.execute({ @Sendable executionContext in
await delivery.sendValue(operation())
}, in: executionContext, priority: priority)
}
},
)
actorQueue.taskStreamContinuation.yield(task)
self.init(priority: priority) {
Expand All @@ -286,7 +286,7 @@ extension Task {
await semaphore.signal()
return await delivery.getValue()
},
onCancel: delivery.cancel
onCancel: delivery.cancel,
)
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@ extension Task {
public init(
priority: TaskPriority? = nil,
on actorQueue: ActorQueue<MainActor>,
operation: @escaping @MainActor () async throws -> Success
operation: @escaping @MainActor () async throws -> Success,
) where Failure == any Error {
let delivery = Delivery<Success, Failure>()
let semaphore = Semaphore()
Expand All @@ -336,7 +336,7 @@ extension Task {
await delivery.sendFailure(error)
}
}, in: executionContext, priority: priority)
}
},
)
actorQueue.taskStreamContinuation.yield(task)
self.init(priority: priority) {
Expand All @@ -345,7 +345,7 @@ extension Task {
await semaphore.signal()
return try await delivery.getValue()
},
onCancel: delivery.cancel
onCancel: delivery.cancel,
)
}
}
Expand Down
Loading