Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using NSProgress as a Cancellation Token #34

Open
ChrisSchneider opened this issue May 18, 2014 · 4 comments
Open

Using NSProgress as a Cancellation Token #34

ChrisSchneider opened this issue May 18, 2014 · 4 comments

Comments

@ChrisSchneider
Copy link

After reading about the interesting idea of cancellation tokens in the readme,
I thought about using NSProgress instead of implementing it on my own.
Are there any known problems or issues with this approach?

@lxcid
Copy link

lxcid commented Dec 2, 2014

Interesting suggestion. As Ole Begemann mentioned in his post, NSProgress is thread-safe.

The only issue this might be a problem is when you (or some other libraries) use it to create tree of progress.
It actually make sense to recommendsNSProgress as cancellation token. It can then hook up to system behaviour.

I'll be trying your suggestion out. :)

@josephearl
Copy link

I think my preference would be to write classes similar to CancellationToken and IProgress for cross-platform consistency - though it would certainly be a good idea to allow creating a CancellationTokenSource or IProgress from an NSProgress.

@josephearl
Copy link

See #89

@tettoffensive
Copy link

@josephearl is there an example somewhere of how I can use NSProgress with BFTasks? I have some videos that are going through an encoding process and uploading process and want to show the user a progress bar with the ability to cancel as well. But I'm a bit lost as to where to start. Right now I have a "progress" block that sits outside the bftask infrastructure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants