Will FutureProofing be getting an update soon?
kenlaws opened this issue · 3 comments
kenlaws commented
Will FutureProofing be getting an update soon?
phimage commented
@Thomvis if you have no time for FutureProofing
add me as collaborator
I can update it to swift 3 (after merging my PR Thomvis/FutureProofing#6 of course)
Thomvis commented
Thanks for the offer @phimage. I've added you as a contributor to FutureProofing. Looking forward to Swift 3 support!
phimage commented
FutureProofing updated to swift 3 Thomvis/FutureProofing@94d4236
I create a file BrightFuture+FutureProofing.swift to be able to use generic Error
into completion handler (It's inspired from PR #108)
Then I add @escaping
to materialize
function
Later some code could be reported to BrightFuture and more
public extension DispatchQueue {
public func asyncResult<T>(_ execute: @escaping () throws -> T) -> Future<T, AnyError> {
return Future { completion in
async {
do {
try completion(.success(execute()))
} catch let e {
completion(.failure(AnyError(cause: e)))
}
}
}
}
}