Skip to content

Commit 9bddf75

Browse files
authored
PostgresNotificationSequence is not Sendable in 5.6 (vapor#392)
`AsyncThrowingStream` is not `Sendable` in Swift 5.6. Because of this `PostgresNotificationSequence` can not be `Sendable` in 5.6.
1 parent b6597f7 commit 9bddf75

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/PostgresNIO/New/PostgresNotificationSequence.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ public struct PostgresNotification: Sendable {
33
public let payload: String
44
}
55

6-
public struct PostgresNotificationSequence: AsyncSequence, Sendable {
6+
public struct PostgresNotificationSequence: AsyncSequence {
77
public typealias Element = PostgresNotification
88

99
let base: AsyncThrowingStream<PostgresNotification, Error>
@@ -20,3 +20,8 @@ public struct PostgresNotificationSequence: AsyncSequence, Sendable {
2020
}
2121
}
2222
}
23+
24+
#if swift(>=5.7)
25+
// AsyncThrowingStream is marked as Sendable in Swift 5.6
26+
extension PostgresNotificationSequence: Sendable {}
27+
#endif

0 commit comments

Comments
 (0)