Skip to content

Commit 200a94a

Browse files
authored
Explicitly mark the AsyncSequence iterators as non Sendable (#490)
1 parent f55caa7 commit 200a94a

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import PackageDescription
33

44
let swiftSettings: [SwiftSetting] = [
5-
.enableUpcomingFeature("StrictConcurrency")
5+
.enableUpcomingFeature("StrictConcurrency"),
66
]
77

88
let package = Package(

Sources/PostgresNIO/New/PostgresNotificationSequence.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ public struct PostgresNotificationSequence: AsyncSequence, Sendable {
2020
}
2121
}
2222
}
23+
24+
@available(*, unavailable)
25+
extension PostgresNotificationSequence.AsyncIterator: Sendable {}

Sources/PostgresNIO/New/PostgresQuery.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension PostgresQuery: ExpressibleByStringInterpolation {
2626
}
2727

2828
extension PostgresQuery {
29-
public struct StringInterpolation: StringInterpolationProtocol {
29+
public struct StringInterpolation: StringInterpolationProtocol, Sendable {
3030
public typealias StringLiteralType = String
3131

3232
@usableFromInline

Sources/PostgresNIO/New/PostgresRowSequence.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import NIOConcurrencyHelpers
44
/// An async sequence of ``PostgresRow``s.
55
///
66
/// - Note: This is a struct to allow us to move to a move only type easily once they become available.
7-
public struct PostgresRowSequence: AsyncSequence {
7+
public struct PostgresRowSequence: AsyncSequence, Sendable {
88
public typealias Element = PostgresRow
99

1010
typealias BackingSequence = NIOThrowingAsyncSequenceProducer<DataRow, Error, AdaptiveRowBuffer, PSQLRowStream>
@@ -56,6 +56,9 @@ extension PostgresRowSequence {
5656
}
5757
}
5858

59+
@available(*, unavailable)
60+
extension PostgresRowSequence.AsyncIterator: Sendable {}
61+
5962
extension PostgresRowSequence {
6063
public func collect() async throws -> [PostgresRow] {
6164
var result = [PostgresRow]()

0 commit comments

Comments
 (0)