2019-12-02a few seconds read (About 65 words)How to convert from callback to Future Publisher in CombineIssue #527 123456789101112131415161718192021import Foundationimport Combinepublic typealias TaskCompletion = (Result<(), Error>) -> Voidpublic protocol Task: AnyObject { var name: String { get } func run(workflow: Workflow, completion: TaskCompletion)}public extension Task { func asPublisher(workflow: Workflow) -> AnyPublisher<(), Error> { return Future({ completion in self.run(workflow: workflow, completion: completion) }).eraseToAnyPublisher() }}let sequence = Publishers.Sequence<[AnyPublisher<(), Error>], Error>( sequence: tasks.map({ $0.asPublisher(workflow: self) }))#swiftcombine