@@ -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
183183dependencies: [
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: [
190190To 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