Overdrive
Overdrive copied to clipboard
maxConcurrentCount=1 only executes the first task in the queue
Overdrive: 0.3
Package manager (SPM, Carthage, CocoaPods, Manual): n/a
Xcode: 8.3.2 (macOS 10.12.5)
Platform: iOS
When TaskQueue.maximumConcurrentTaskCount = 1`, only one task is executed. (The 2nd task is not executed.)
Here is a test case that indicates the issue.
func testTwoTaskShouldBothCompleteWhenMaxConcurrentTaskCountIsOne() {
queue.maxConcurrentTaskCount = 1
let expectation1 = self.expectation(description: "a")
let expectation2 = self.expectation(description: "b")
let task = anyTask(withResult: .value(1))
task.onValue { _ in
expectation1.fulfill()
}
let task2 = anyTask(withResult: .value(1))
task2.onValue { _ in
expectation2.fulfill()
}
queue.add(task: task)
queue.add(task: task2)
waitForExpectations(timeout: 5)
}
The test fails as the "b" expectation is unfulfilled. Any ideas what could be wrong?
Hi @xinsight, I'm looking into it.
Hi @arikis, what is the current state of this issue? Any insights? I'm experimenting with the current swift4 branch (bd7550b27f0023ba0e612e0e56b9e0ecd06f7705) and can see a similar behaviour (Xcode 9, iOS 11).