Closed Tchoupinax closed 5 years ago
Hi @Tchoupinax,
How about the following:
let storageQueue = DispatchQueue(label: "StorageQueue", qos: .userInitiated)
all(a, b, c).then(on: storageQueue) { aResult, bResult, cResult, in
StorageService.setItem(key: "a", value: a.rawString()!)
StorageService.setItem(key: "b", value: b.rawString()!)
StorageService.setItem(key: "c", value: c.rawString()!)
}.then {
print("COMPLETION")
}.catch {
error in print(error)
}
Hello,
After making
all
method working well, i try to await this to resolve before to continue the next code. This following is my codea, b and c are three promises with each one a specific DispatchQueue. I tried many things, as the following
The problem is that if i replace the thread global by
.main
or other, i make a deadlock promise. With.global()
i do not have the problem but code execution does not wait for the resolve. I am wondering how can i make it, in the best way as far as possible. :)Thank you for your time. :)