This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProgressFuture<Output, Failure: Error> { | |
let future: Future<Output, Failure> | |
let progress: Progress | |
init(_ attemptToFulfill: @escaping (@escaping Future<Output, Failure>.Promise, Progress) -> Void) { | |
let progress = Progress() | |
self.future = Future { promise in attemptToFulfill(promise, progress) } | |
self.progress = progress | |
} | |
} |