How do people handle shutdown of applications while async/await stuff is still executing? I do a lot of desktop app and need to stop executing when it closes. With the async stuff it's really hard to tell what's still in the queue to be executed and should be waited for.
Is the whole pattern more for server stuff where you can assume there will be no shutdowns?
If you're on OSX/iOS you would use an NSOperation and NSOperationQueue.
Your NSOperation objects would conform to the NSCoding protocol. Then you would iterate through NSOperationQueue.operations and use NSKeyedArchiver to serialize.
Is the whole pattern more for server stuff where you can assume there will be no shutdowns?