Skip to content

Commit 0d31775

Browse files
committed
Comments
Signed-off-by: Adam Fowler <[email protected]>
1 parent b23c88e commit 0d31775

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/Valkey/Subscriptions/ValkeyClient+subscribe.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,15 @@ extension ValkeyClient {
185185
try Task.checkCancellation()
186186
return try await self.withConnection { connection in
187187
try await connection.subscribe(command: command, filters: filters) { subscription in
188+
// push messages on connection subscription to client subscription
188189
for try await message in subscription {
189190
cont.yield(message)
190191
}
191192
}
192193
cont.finish()
193194
}
194195
} catch let error as ValkeyClientError {
196+
// if connection closes for some reason don't exit loop so it opens a new connection
195197
switch error.errorCode {
196198
case .connectionClosed, .connectionClosedDueToCancellation, .connectionClosing:
197199
break

0 commit comments

Comments
 (0)