Skip to content

Commit 263175b

Browse files
committed
Marked AsyncIterators as not Sendable
1 parent 3ff7021 commit 263175b

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct RetryDelaySequence: Sequence, Sendable {
4545
}
4646

4747
@usableFromInline
48-
struct Iterator: IteratorProtocol, Sendable {
48+
struct Iterator: IteratorProtocol {
4949
@usableFromInline
5050
let policy: RetryPolicy
5151
@usableFromInline
@@ -99,3 +99,6 @@ struct RetryDelaySequence: Sequence, Sendable {
9999
}
100100
}
101101
}
102+
103+
@available(*, unavailable)
104+
extension RetryDelaySequence.Iterator: Sendable {}

Sources/GRPCCore/Coding/CompressionAlgorithm.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ extension CompressionAlgorithmSet {
107107
return Iterator(algorithmSet: self.algorithmSet)
108108
}
109109

110-
public struct Iterator: IteratorProtocol, Sendable {
110+
public struct Iterator: IteratorProtocol {
111111
private let algorithmSet: CompressionAlgorithmSet
112112
private var iterator: IndexingIterator<[CompressionAlgorithm.Value]>
113113

@@ -128,3 +128,6 @@ extension CompressionAlgorithmSet {
128128
}
129129
}
130130
}
131+
132+
@available(*, unavailable)
133+
extension CompressionAlgorithmSet.Elements.Iterator: Sendable {}

Sources/GRPCCore/Streaming/Internal/AsyncSequenceOfOne.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct AsyncSequenceOfOne<Element: Sendable, Failure: Error>: AsyncSequence, Sen
4949
}
5050

5151
@usableFromInline
52-
struct AsyncIterator: AsyncIteratorProtocol, Sendable {
52+
struct AsyncIterator: AsyncIteratorProtocol {
5353
@usableFromInline
5454
private(set) var result: Result<Element, Failure>?
5555

@@ -74,3 +74,6 @@ struct AsyncSequenceOfOne<Element: Sendable, Failure: Error>: AsyncSequence, Sen
7474
}
7575
}
7676
}
77+
78+
@available(*, unavailable)
79+
extension AsyncSequenceOfOne.AsyncIterator: Sendable {}

Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct BroadcastAsyncSequence<Element: Sendable>: Sendable, AsyncSequence {
8989
@available(gRPCSwift 2.0, *)
9090
extension BroadcastAsyncSequence {
9191
@usableFromInline
92-
struct AsyncIterator: AsyncIteratorProtocol, Sendable {
92+
struct AsyncIterator: AsyncIteratorProtocol {
9393
@usableFromInline
9494
let _storage: _BroadcastSequenceStorage<Element>
9595
@usableFromInline
@@ -111,6 +111,9 @@ extension BroadcastAsyncSequence {
111111
}
112112
}
113113

114+
@available(*, unavailable)
115+
extension BroadcastAsyncSequence.AsyncIterator: Sendable {}
116+
114117
// MARK: - Continuation
115118

116119
@available(gRPCSwift 2.0, *)

0 commit comments

Comments
 (0)