Is there a way to avoid a possible race between pausing and resuming the flow in the following example?
Code Block class FilterDataProvider: NEFilterDataProvider { override func handleNewFlow(_ flow: NEFilterFlow) -> NEFilterNewFlowVerdict { /* this block is submitted for async processing */ { let verdict: NEFilterNewFlowVerdict = self.makeDecision(flow) ? .allow() : .drop() self.resumeFlow(flow, with: verdict) } return .pause() } }
Since the flow is paused after the handleNewFlow() function returns, it seems impossible to ensure that resumeFlow() is called after the flow is actually paused.
Is there any suggested way of avoiding this race?
Thanks