Skip to content

Conversation

@inamiy
Copy link
Member

@inamiy inamiy commented Dec 20, 2014

This pull request will enable Task to pause its execution on init(),
and manually resume() to start running (like NSURLSessionTask).

This feature will be useful in ReactKit for creating "cold signal" as well.

Usage

// define task
let task = Task(paused: true) { progress, fulfill, reject, configure in
    ... // this closure will be invoked on 1st `resume()`
}

// task.state is `.Paused` at this point

task.resume()    // start running

inamiy added a commit that referenced this pull request Dec 20, 2014
@inamiy inamiy merged commit e82a704 into master Dec 20, 2014
@inamiy inamiy deleted the paused-init branch December 20, 2014 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants