AsyncValueObservation is Sendable

A Sendable async sequences plays well with apple/swift-async-algorithms
This commit is contained in:
Gwendal Roué committed 2024-09-28 13:36:40 +02:00
1 parent c404e2d012
commit 6b2ccebad3
1 file changed
+4 -2
+4 -2
View File
@@ -384,11 +384,13 @@ extension ValueObservation {
///
/// You build an `AsyncValueObservation` from ``ValueObservation`` or
/// ``SharedValueObservation``.
public struct AsyncValueObservation<Element: Sendable>: AsyncSequence {
public struct AsyncValueObservation<Element: Sendable>: AsyncSequence, Sendable {
public typealias BufferingPolicy = AsyncThrowingStream<Element, Error>.Continuation.BufferingPolicy
public typealias AsyncIterator = Iterator
var bufferingPolicy: BufferingPolicy
// AsyncThrowingStream.Continuation.BufferingPolicy is obviously
// Sendable, but lacks Sendable conformance.
nonisolated(unsafe) var bufferingPolicy: BufferingPolicy
var start: ValueObservationStart<Element>
public func makeAsyncIterator() -> Iterator {