Mark ValueObservation starting methods as @preconcurrency

I guess the compiler will learn to stop emitting warnings eventually.

https://mjtsai.com/blog/2024/09/20/unwanted-swift-concurrency-checking/
This commit is contained in:
Gwendal Roué committed 2024-09-21 12:30:38 +02:00
1 parent bdb7d84086
commit 58a2e04736
3 files changed
+8 -8

No files matched your search

@@ -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``
@@ -224,7 +224,7 @@ public final class SharedValueObservation<Element: Sendable>: @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
+5 -5
View File
@@ -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<Value>(
@preconcurrency public static func trackingConstantRegion<Value>(
_ fetch: @escaping @Sendable (Database) throws -> Value)
-> Self
where Reducer == ValueReducers.Fetch<Value>
@@ -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<Value>(
@preconcurrency public static func tracking<Value>(
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<Value>(
@preconcurrency public static func tracking<Value>(
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<Value>(
@preconcurrency public static func tracking<Value>(
_ fetch: @escaping @Sendable (Database) throws -> Value)
-> Self
where Reducer == ValueReducers.Fetch<Value>