Comments (12)
I also tested this in two largest projects I have, which are both using Operations for networking and data storage. TSan reports no issues and anything I tried worked fine.
I suspect a large part of this working properly is due to KVO improvements done in Swift itself. I'll keep an eye on this in future projects.
from swift-essentials.
This is first time I hear about the progress property, thanks for letting me know. Feel free to fork and play with it – I'll be very happy to accept pull requests for this.
from swift-essentials.
Thanks. After a good night's sleep it wasn't so hard to figure out: #6 fixes this.
from swift-essentials.
Will need to investigate some other solution (see my comment on the PR 6).
from swift-essentials.
OK. There seems to be a conflict between two official documentations :) The developer docs and the comment from Apple in the NSOperation.h.
from swift-essentials.
I'll need to revisit my start method override, do I even need it.
from swift-essentials.
I filed a feedback with Apple to see what they have to say about this. I'll let you know once I know.
from swift-essentials.
Try with the version I just pushed (for history: this commit).
Completely different internals, start is not overriden, just main()
and isFinished
.
from swift-essentials.
Also, please do a test run with Thread Sanitizer enabled, on whatever project you are using this.
from swift-essentials.
Nice one! Works fine in the test project where I was troubleshooting the progress as well as in the actual project (upcoming release of https://anyfinder.info).
No complaints from Thread Sanitizer in either project.
Thanks!
from swift-essentials.
Not sure if this is related to the change but I am now getting a crash at another point in the app that also uses the queue.
It's a
Thread 3: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) *** -[NSKeyValueObservance retain]: message sent to deallocated instance 0x6000013bdc50
exception and when I trace it back in the call stack I land at
didChangeValue(forKey: "isFinished")
from swift-essentials.
#5 (comment) is not related. My bad.
from swift-essentials.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-essentials.