SwiftPhoenixClient
SwiftPhoenixClient copied to clipboard
async/await URLSessionWebSocketTask receive
Just looking over #280 -- @dsrees I haven't independently verified this but want to call your attention to this post: https://www.donnywals.com/iterating-over-web-socket-messages-with-async-await-in-swift/
Check the last part of the post (search for "If you're targetting iOS 17 or newer you can ignore this next part")
Apparently there's a bug with cancelling URLSessionWebSocketTask in older iOS that may impact this (otherwise very appealing) change. Causing Tasks that never finish, hanging on an await.
Hm maybe the best thing is to check OS and switch between async and a callback.
I also want to explore using the Network framework for the underlying connection