Skip to content

Commit

Permalink
Fixed wait(for:fileDescriptor:)
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed May 13, 2023
1 parent 322cd72 commit c67494e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Socket/SocketManager/AsyncSocketManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ private extension AsyncSocketManager {
try await withThrowingContinuation(for: fileDescriptor) { (continuation: SocketContinuation<(), Swift.Error>) -> () in
// store pending continuation
Task {
guard await socket.pendingEvents.contains(events) == false else {
continuation.resume()
return
}
await socket.queue(events, continuation)
}
}
Expand Down

0 comments on commit c67494e

Please sign in to comment.