Promises are a well-known design pattern used to delay evaluation of future values, and to pipeline operations in an asynchronous manner. Typically, there are three internal states: Pending, Fulfilled, Rejected, used to control Promises’ behavior, but this lacks core interfaces such as Cancel, Pause, Resume, Progress, that are all essential in our daily iOS & OS X development. Needing more powerful classes than Promise or NSOperation, SwiftTask was created, and entirely written in Swift.
By taking a closer look into SwiftTask's resume/progress handling, we will explore a new approach to the Reactive Programming paradigm. Every Task will eventually become a Stream.