On Darwin, asynchronous usage of Operation is supported via KVO notifications.
Because KVO is only available on Darwin platforms, swift-corelibs-foundation currently does not support asychronous Operations, and there is a comment to that effect:
My understanding is that it's unlikely KVO will arrive on Linux any time soon, so this leaves us with a problem in Operation. Asynchronous usage of Operation is an important feature.
Is there any way that we could support asynchronous operations in swift-corelibs-foundation, in the absence of KVO?
So perhaps you misunderstood my comment? What are you meaning by asynchronous operation? Technically all operations running in a queue are “asynchronous” on Darwin or on Linux.
My commentary was about the cases where main finishes execution and the operation is not finished.
The subclassers of Operation would need to somehow notify the super-class that the operation is finished. And we would need to have a mechanism to understand if the subclasser is overriding main or start (or both?!)
Might it be acceptable to add extra temporary public API to enable this?
There is never a thing as temporary API - it haunts us for ever
I think it would be better to advocate a sound design pattern that would facilitate proper implementations on all platforms instead… Perhaps like; how does one properly use run loops in the context of Operation or dispatch. Often that is a suitable way to make things that act asynchronously without consuming another thread/queue.
On Jan 20, 2017, at 7:55 AM, Ian Partridge via swift-corelibs-dev <email@example.com> wrote:
swift-corelibs-dev mailing list