Skip to content

Commit

Permalink
AsyncValueObservation is Sendable
Browse files Browse the repository at this point in the history
A Sendable async sequences plays well with apple/swift-async-algorithms
  • Loading branch information
groue committed Sep 28, 2024
1 parent 972aa33 commit 820f0a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions GRDB/ValueObservation/ValueObservation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 820f0a1

Please sign in to comment.