We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4d04af commit 251d781Copy full SHA for 251d781
1 file changed
Sources/Socket/SocketManager.swift
@@ -34,15 +34,15 @@ internal final class SocketManager {
34
Task.detached(priority: Socket.configuration.monitorPriority) { [unowned self] in
35
while await self.isMonitoring {
36
do {
37
- let hasEvents = try await storage.update {
+ let hasEvents = try await storage.update({ (state: inout ManagerState) -> Bool in
38
// poll
39
- let hasEvents = try $0.poll()
+ let hasEvents = try state.poll()
40
// stop monitoring if no sockets
41
- if $0.pollDescriptors.isEmpty {
42
- $0.isMonitoring = false
+ if state.pollDescriptors.isEmpty {
+ state.isMonitoring = false
43
}
44
return hasEvents
45
- }
+ })
46
if hasEvents == false {
47
try await Task.sleep(nanoseconds: Socket.configuration.monitorInterval)
48
0 commit comments