Open leancmscn opened 8 years ago
@leancmscn The README file shows an example using GCDGroups: https://github.com/JohnEstropia/GCDKit#launching-and-reporting-completion-of-a-group-of-tasks
Isn't this what you are looking for?
GCDGroups not suit for unlimited task, only suit for tasks added one by one.
let dispatchGroup = GCDGroup()
dispatchGroup.enter()
doSomeLongTaskWithCompletion {
dispatchGroup.leave()
}
for task in tasks {
dispatchGroup.async(.Default) {
task
}
}
dispatchGroup.notify(.Main) {
// report completion
}
right?
uploadQueen = GDDQueue("upload") uploadQueen.addTask([task1, task2, task3]).notify({
})
like this