diff --git a/GRDB/Documentation.docc/Extension/ValueObservation.md b/GRDB/Documentation.docc/Extension/ValueObservation.md index 6abaa6b28..f2535e93e 100644 --- a/GRDB/Documentation.docc/Extension/ValueObservation.md +++ b/GRDB/Documentation.docc/Extension/ValueObservation.md @@ -312,8 +312,8 @@ When needed, you can help GRDB optimize observations and reduce database content ### Accessing Observed Values - ``publisher(in:scheduling:)`` -- ``start(in:scheduling:onError:onChange:)-79cet`` -- ``start(in:scheduling:onError:onChange:)-5wpgl`` +- ``start(in:scheduling:onError:onChange:)-10vwf`` +- ``start(in:scheduling:onError:onChange:)-7z197`` - ``values(in:scheduling:bufferingPolicy:)`` - ``DatabaseCancellable`` - ``ValueObservationScheduler`` diff --git a/GRDB/ValueObservation/SharedValueObservation.swift b/GRDB/ValueObservation/SharedValueObservation.swift index ce30595a1..b3881a59c 100644 --- a/GRDB/ValueObservation/SharedValueObservation.swift +++ b/GRDB/ValueObservation/SharedValueObservation.swift @@ -224,7 +224,7 @@ public final class SharedValueObservation: @unchecked Sendabl /// - parameter onChange: The closure to execute on receipt of a /// fresh value. /// - returns: A DatabaseCancellable that can stop the observation. - public func start( + @preconcurrency public func start( onError: @escaping @Sendable (Error) -> Void, onChange: @escaping @Sendable (Element) -> Void) -> AnyDatabaseCancellable diff --git a/GRDB/ValueObservation/ValueObservation.swift b/GRDB/ValueObservation/ValueObservation.swift index ac6816e66..3b0de8ef9 100644 --- a/GRDB/ValueObservation/ValueObservation.swift +++ b/GRDB/ValueObservation/ValueObservation.swift @@ -119,7 +119,7 @@ extension ValueObservation: Refinable { /// - parameter onChange: The closure to execute on receipt of a /// fresh value. /// - returns: A DatabaseCancellable that can stop the observation. - public func start( + @preconcurrency public func start( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationScheduler, onError: @escaping @Sendable (Error) -> Void, @@ -787,7 +787,7 @@ extension ValueObservation { /// ``` /// /// - parameter fetch: The closure that fetches the observed value. - public static func trackingConstantRegion( + @preconcurrency public static func trackingConstantRegion( _ fetch: @escaping @Sendable (Database) throws -> Value) -> Self where Reducer == ValueReducers.Fetch @@ -859,7 +859,7 @@ extension ValueObservation { /// - parameter otherRegions: A list of supplementary regions /// to observe. /// - parameter fetch: The closure that fetches the observed value. - public static func tracking( + @preconcurrency public static func tracking( region: any DatabaseRegionConvertible, _ otherRegions: any DatabaseRegionConvertible..., fetch: @escaping @Sendable (Database) throws -> Value) @@ -929,7 +929,7 @@ extension ValueObservation { /// /// - parameter regions: An array of observed regions. /// - parameter fetch: The closure that fetches the observed value. - public static func tracking( + @preconcurrency public static func tracking( regions: [any DatabaseRegionConvertible], fetch: @escaping @Sendable (Database) throws -> Value) -> Self @@ -987,7 +987,7 @@ extension ValueObservation { /// ``` /// /// - parameter fetch: The closure that fetches the observed value. - public static func tracking( + @preconcurrency public static func tracking( _ fetch: @escaping @Sendable (Database) throws -> Value) -> Self where Reducer == ValueReducers.Fetch