4 ms·
Swift gems for creating reliable, concurrent OS X desktop apps
- empyrical 11y agoI seem to be getting an invalid certificate warning on this site, is this happening for anyone else?
- gurkendoktor 11y agoThe site uses the StartCom CA, which offers free SSL certificates. I like their service, but I remember that my old OS X 10.5 box does not recognise them, either. It seems to be a relatively recent addition: http://www.istartedsomething.com/20091010/microsoft-free-root-certificate-authority-windows/ http://www.istartedsomething.com/20091010/microsoft-free-roo...
- __bb 11y agoThe Failable type in the article looks like this Result project on GitHub [1]. It makes for interesting related reading. [1]: https://github.com/antitypical/Result https://github.com/antitypical/Result
- joncooper 11y agoIf this interests you, definitely consider taking https://www.coursera.org/course/reactive https://www.coursera.org/course/reactive
- Sidnicious 11y agoShameless plug for my tiny implementation of Promise (similar to the Future type mentioned in the article)[1]. I've used it in a few projects, and it makes dealing with async things feel surprisingly natural: getLocation() .then { apiRequest(params, location: $0) } .then { json -> () in for result in json["results"] { display(result) } } .catch { showError($0) } It's also easy trivial to adapt existing callback-based[2] and delegate-based[3] APIs to promises. [1]: https://gist.github.com/Sidnicious/93d2a8db1266e2fd239c https://gist.github.com/Sidnicious/93d2a8db1266e2fd239c [2]: https://gist.github.com/Sidnicious/69df2c483aadc08bda4f https://gist.github.com/Sidnicious/69df2c483aadc08bda4f [3]: https://gist.github.com/Sidnicious/99b099d9b6f2ecb9e383 https://gist.github.com/Sidnicious/99b099d9b6f2ecb9e383
- SeoxyS 11y ago> LOGGING FROM DIFFERENT BACKGROUND THREADS AT ONCE Or, you could just make a logging serial queue that you send all log messages to; that way there's no risk of activity on the main thread slowing down your logging. In (Obj-)C: static queue_t queue; void log (NSString *message) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ queue = dispatch_queue_create("logging", DISPATCH_QUEUE_SERIAL); }); dispatch_async(queue, ^{ NSLog(message); }); }
- misterdata 11y agoThis only works right if none of the frameworks you use log anything by themselves - messages will get garbled otherwise. Logging through the main queue exhibits the same issue, but at least Cocoa logging (which is always in the main thread) is dealt with.