[swift-corelibs-dev] Asynchronous Operations

Tony Parker anthony.parker at apple.com
Mon Jan 23 11:32:27 CST 2017


Hm, that’s probably the least bad option we have at the moment.

I don’t want to introduce “new” API, as it is unlikely we will be able to remove it when whatever permanent solution comes up.

- Tony

> On Jan 21, 2017, at 6:09 AM, Brent Royal-Gordon via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
> 
>> On Jan 20, 2017, at 7:55 AM, Ian Partridge via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
>> 
>> Is there any way that we could support asynchronous operations in swift-corelibs-foundation, in the absence of KVO?
> 
> Could we add `willChangeValue(forKey:)` and `didChangeValue(forKey:)` methods just to `Operation` which only handle an `isFinished` key? Presumably they'd just look like:
> 
> 	public func willChangeValue(forKey key: String) {
> 		// do nothing
> 	}
> 	public func didChangeValue(forKey key: String) {
> 		if key == "isFinished" && isFinished {
> 			finish()
> 		}
> 	}
> 
> I believe that would make existing code just work without needing to do anything special.
> 
> -- 
> Brent Royal-Gordon
> Architechies
> 
> _______________________________________________
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev



More information about the swift-corelibs-dev mailing list