davidstump / SwiftPhoenixClient

Connect your Phoenix and iOS applications through WebSockets!
MIT License
506 stars 146 forks source link

Correct `URLSession` delegate queue #232

Closed ejensen closed 1 year ago

ejensen commented 1 year ago

The URLSession documentation notes that delegateQueue:

should be a serial queue, in order to ensure the correct ordering of callbacks. If nil, the session creates a serial operation queue for performing all delegate method calls and completion handler calls

Creating a new OperationQueue() makes a concurrent queue which can lead to inconsistent ordering of lifecycle events. This change switches to use the default delegate queue when creating a URLSession.