Skip to content

Commit

Permalink
Fixed Swift 5.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Oct 6, 2022
1 parent d4d04af commit 251d781
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Socket/SocketManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ internal final class SocketManager {
Task.detached(priority: Socket.configuration.monitorPriority) { [unowned self] in
while await self.isMonitoring {
do {
let hasEvents = try await storage.update {
let hasEvents = try await storage.update({ (state: inout ManagerState) -> Bool in
// poll
let hasEvents = try $0.poll()
let hasEvents = try state.poll()
// stop monitoring if no sockets
if $0.pollDescriptors.isEmpty {
$0.isMonitoring = false
if state.pollDescriptors.isEmpty {
state.isMonitoring = false
}
return hasEvents
}
})
if hasEvents == false {
try await Task.sleep(nanoseconds: Socket.configuration.monitorInterval)
}
Expand Down

0 comments on commit 251d781

Please sign in to comment.