public class ProxyCompletionRequirement<T> : CompletionRequirement<T>
ProxyCompletionRequirement allows you to provide a completion requirement that adds some custom completion logic
to an existing completion instance, and then return a possibly modified result value to the original requirement.
This mechanism allows your code to
not care whether the completion you are proxying is called synchronously or not.
Normally you need to know if completion you are wrapping would be called async or not, as you would need to
capture the async completion status before defining your completion block so it can call
completed on the async result.
This is a bit nasty in the nuance of the implementation. We may remove this if
The proxy must indicate that the original completion will complete async, but we return our own proxy async status object because we need to inject our own completion handling logic to possibly mutate the value.
override public func willCompleteAsync() -> DeferredStatus
The proxy calls its own
completedAsyncin order to execute the custom value modification logic, and that will in fact call the original completion’s
override public func completedSync(_ result: T) -> SyncCompletionStatus