Essentially, I have a lazily established network connection that I need to ensure only one attempt to establish, while others await that attempt's success (or failure). I implemented a simple semaphore class using withCheckedContinuation and used that to isolate the connection attempt. In this case, I know there is no deadlock risk. However, I'd be curious if there are safer approaches you have in mind.
Topic:
Programming Languages
SubTopic:
Swift
Tags: