Guest User

Untitled

a guest
Feb 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. final class Payload { }
  2.  
  3. final class LongOperationsChain {
  4. private func process() -> Future<Payload> {
  5. return startMainQueueOperation().then(backgroundQueueOperation(with:)).then(mainQueueOperation(with:))
  6. }
  7.  
  8. private func startMainQueueOperation() -> Future<Payload> { return Promise<Payload>().future }
  9. private func backgroundQueueOperation(with payload: Payload) -> Payload { return payload }
  10. private func mainQueueOperation(with payload: Payload) -> Payload { return payload }
  11.  
  12. private let backgroundQueue: DispatchQueue
  13. }
Add Comment
Please, Sign In to add comment