You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps I am over-complicating things or missing some aspect of swift async that would make this work nicely.
However the present problem I have is that socket.once() does not have a timeout nor can I get it to "cancel"
See below an example where I am trying to wrap socket.once() into swift async and use withCheckedContinuation to safely wrap up the non swift async code but have no way to call the continuation after a timeout nor propagate the cancel downwards.
If you create a task and have it await on waitForPong it will wait indefinitely for that pong. Even if you cancel() the there is no way to get rid of your now stuck Task.
Even if I off or cancel it I do not get the handler needed for the NormalCallback
The text was updated successfully, but these errors were encountered:
CalebKierum
changed the title
Timeout or way to cancel socketClient.once() so that .once() can be safely wrapped in a withCheckedContinuation swift async block
Timeout or way to cancel socketClient.once() so that .once() can be safely wrapped in a withCheckedContinuation swift async block
Dec 12, 2024
Perhaps I am over-complicating things or missing some aspect of swift async that would make this work nicely.
However the present problem I have is that
socket.once()
does not have a timeout nor can I get it to "cancel"See below an example where I am trying to wrap socket.once() into swift async and use
withCheckedContinuation
to safely wrap up the non swift async code but have no way to call the continuation after a timeout nor propagate the cancel downwards.If you create a task and have it await on
waitForPong
it will wait indefinitely for that pong. Even if youcancel()
the there is no way to get rid of your now stuck Task.Even if I off or cancel it I do not get the handler needed for the
NormalCallback
The text was updated successfully, but these errors were encountered: