项目作者: S2Ler

项目描述 :
Simple wrapper around NSOperation to allow operation chaining.
高级语言: Swift
项目地址: git://github.com/S2Ler/Procedure.git
创建时间: 2017-12-29T15:14:36Z
项目社区:https://github.com/S2Ler/Procedure

开源协议:MIT License

下载


Procedure

Swift 4, SPM

Simple wrapper around NSOperation to allow operation chaining.

Usage

  1. Procedure<Void, Bool>(executeOn: queue, { (_, fullfill) in
  2. Thread.sleep(forTimeInterval: 0.3)
  3. fullfill(true)
  4. }).then(Procedure<Bool, Int>(executeOn: queue, { (op1Result, fullfill) in
  5. Thread.sleep(forTimeInterval: 0.3)
  6. fullfill(op1Result ? 1 : 0)
  7. })).finally { (result) in
  8. // Do something with the result from previous procedure
  9. }

TODO:

  • improve chaining performance when there are a lot of operations in queue
  • iOS xcodeproj
  • add sugar and improve interface and comman usages
  • travis