Skip to content

Commit 29c4c44

Browse files
committed
Create Task API -> 0.7.0
1 parent 2985121 commit 29c4c44

File tree

11 files changed

+982
-587
lines changed

11 files changed

+982
-587
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
ruby-version: '3.3.5'
1919
bundler-cache: true
2020
- name: Select Xcode Version
21-
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
21+
run: sudo xcode-select --switch /Applications/Xcode_16.1.app/Contents/Developer
2222
- name: Download visionOS
2323
run: |
2424
sudo xcodebuild -runFirstLaunch
@@ -46,7 +46,7 @@ jobs:
4646
ruby-version: '3.3.5'
4747
bundler-cache: true
4848
- name: Select Xcode Version
49-
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
49+
run: sudo xcode-select --switch /Applications/Xcode_16.1.app/Contents/Developer
5050
- name: Download visionOS
5151
if: matrix.platforms == 'visionOS_2'
5252
run: |
@@ -74,7 +74,7 @@ jobs:
7474
ruby-version: '3.3.5'
7575
bundler-cache: true
7676
- name: Select Xcode Version
77-
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
77+
run: sudo xcode-select --switch /Applications/Xcode_16.1.app/Contents/Developer
7878
- name: Build and Test Framework
7979
run: xcrun swift test -c release -Xswiftc -enable-testing
8080
linux:

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ func testFIFOQueueOrdering() async {
5151
actor Counter {
5252
nonisolated
5353
func incrementAndAssertCountEquals(_ expectedCount: Int) {
54-
queue.enqueue {
54+
Task(enqueuedOn: queue) {
5555
await self.increment()
5656
let incrementedCount = await self.count
5757
XCTAssertEqual(incrementedCount, expectedCount) // always succeeds
5858
}
5959
}
6060

6161
func flushQueue() async {
62-
await queue.enqueueAndWait { }
62+
await Task(enqueuedOn: queue) {}.value
6363
}
6464

6565
func increment() {
@@ -101,14 +101,14 @@ func testActorQueueOrdering() async {
101101

102102
nonisolated
103103
func incrementAndAssertCountEquals(_ expectedCount: Int) {
104-
queue.enqueue { myself in
104+
await Task(enqueuedOn: queue) { myself in
105105
myself.count += 1
106106
XCTAssertEqual(expectedCount, myself.count) // always succeeds
107107
}
108108
}
109109

110110
func flushQueue() async {
111-
await queue.enqueueAndWait { _ in }
111+
await Task(enqueuedOn: queue) {}.value
112112
}
113113

114114
private var count = 0
@@ -137,15 +137,15 @@ func testMainActorQueueOrdering() async {
137137
final class Counter {
138138
nonisolated
139139
func incrementAndAssertCountEquals(_ expectedCount: Int) {
140-
MainActorQueue.shared.enqueue {
140+
Task(enqueuedOn: MainActor.queue) {
141141
self.increment()
142142
let incrementedCount = self.count
143143
XCTAssertEqual(incrementedCount, expectedCount) // always succeeds
144144
}
145145
}
146146

147147
func flushQueue() async {
148-
await MainActorQueue.shared.enqueueAndWait { }
148+
await Task(enqueuedOn: MainActor.queue) { }.value
149149
}
150150

151151
func increment() {
@@ -181,7 +181,7 @@ To install swift-async-queue in your project with [Swift Package Manager](https:
181181

182182
```swift
183183
dependencies: [
184-
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.6.0"),
184+
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.7.0"),
185185
]
186186
```
187187

@@ -190,7 +190,7 @@ dependencies: [
190190
To install swift-async-queue in your project with [CocoaPods](http://cocoapods.org), add the following to your `Podfile`:
191191

192192
```
193-
pod 'AsyncQueue', '~> 0.6.0'
193+
pod 'AsyncQueue', '~> 0.7.0'
194194
```
195195

196196
## Contributing

0 commit comments

Comments
 (0)