Skip to content

Commit 8119367

Browse files
committed
Mark all subscription types as unchecked sendable
feature/sendable
1 parent 38abaaa commit 8119367

11 files changed

Lines changed: 15 additions & 11 deletions

Sources/CoreDataRepository/Internal/AggregateSubscription.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import Foundation
99

1010
/// Subscription provider that sends updates when an aggregate fetch request changes
1111
@usableFromInline
12-
final class AggregateSubscription<Value>: Subscription<Value, NSDictionary, NSManagedObject> where Value: Numeric,
12+
final class AggregateSubscription<Value>: Subscription<Value, NSDictionary, NSManagedObject>,
13+
@unchecked Sendable where Value: Numeric,
1314
Value: Sendable
1415
{
1516
@usableFromInline

Sources/CoreDataRepository/Internal/AggregateThrowingSubscription.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import Foundation
99

1010
/// Subscription provider that sends updates when an aggregate fetch request changes
1111
@usableFromInline
12-
final class AggregateThrowingSubscription<Value>: ThrowingSubscription<Value, NSDictionary, NSManagedObject>
12+
final class AggregateThrowingSubscription<Value>: ThrowingSubscription<Value, NSDictionary, NSManagedObject>,
13+
@unchecked Sendable
1314
where Value: Numeric, Value: Sendable
1415
{
1516
@usableFromInline

Sources/CoreDataRepository/Internal/BaseSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class BaseSubscription<
1313
Output,
1414
RequestResult: NSFetchRequestResult,
1515
ControllerResult: NSFetchRequestResult
16-
>: NSObject, NSFetchedResultsControllerDelegate {
16+
>: NSObject, NSFetchedResultsControllerDelegate, @unchecked Sendable {
1717
let request: NSFetchRequest<RequestResult>
1818
let frc: NSFetchedResultsController<ControllerResult>
1919

Sources/CoreDataRepository/Internal/CountSubscription.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import Foundation
99

1010
/// Subscription provider that sends updates when a count fetch request changes
1111
@usableFromInline
12-
final class CountSubscription<Value>: Subscription<Value, NSDictionary, NSManagedObject> where Value: Numeric,
12+
final class CountSubscription<Value>: Subscription<Value, NSDictionary, NSManagedObject>,
13+
@unchecked Sendable where Value: Numeric,
1314
Value: Sendable
1415
{
1516
@usableFromInline

Sources/CoreDataRepository/Internal/CountThrowingSubscription.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import Foundation
99

1010
/// Subscription provider that sends updates when a count fetch request changes
1111
@usableFromInline
12-
final class CountThrowingSubscription<Value>: ThrowingSubscription<Value, NSDictionary, NSManagedObject>
12+
final class CountThrowingSubscription<Value>: ThrowingSubscription<Value, NSDictionary, NSManagedObject>,
13+
@unchecked Sendable
1314
where Value: Numeric, Value: Sendable
1415
{
1516
@usableFromInline

Sources/CoreDataRepository/Internal/FetchSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class FetchSubscription<Model: FetchableUnmanagedModel>: Subscription<
1313
[Model],
1414
Model.ManagedModel,
1515
Model.ManagedModel
16-
> {
16+
>, @unchecked Sendable {
1717
@usableFromInline
1818
override func fetch() {
1919
frc.managedObjectContext.perform { [weak self, frc, request] in

Sources/CoreDataRepository/Internal/FetchThrowingSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class FetchThrowingSubscription<Model: FetchableUnmanagedModel>: ThrowingS
1313
[Model],
1414
Model.ManagedModel,
1515
Model.ManagedModel
16-
> {
16+
>, @unchecked Sendable {
1717
@usableFromInline
1818
override func fetch() {
1919
frc.managedObjectContext.perform { [weak self, frc, request] in

Sources/CoreDataRepository/Internal/ReadSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
/// Subscription provider that sends updates when a single ``NSManagedObject`` changes
1212
@usableFromInline
13-
final class ReadSubscription<Model: ReadableUnmanagedModel> {
13+
final class ReadSubscription<Model: ReadableUnmanagedModel>: @unchecked Sendable {
1414
private let objectId: NSManagedObjectID
1515
private let context: NSManagedObjectContext
1616
private var cancellables: Set<AnyCancellable>

Sources/CoreDataRepository/Internal/ReadThrowingSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import CoreData
99
import Foundation
1010

1111
@usableFromInline
12-
final class ReadThrowingSubscription<Model: ReadableUnmanagedModel> {
12+
final class ReadThrowingSubscription<Model: ReadableUnmanagedModel>: @unchecked Sendable {
1313
private let objectId: NSManagedObjectID
1414
private let context: NSManagedObjectContext
1515
private var cancellables: Set<AnyCancellable>

Sources/CoreDataRepository/Internal/Subscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Subscription<
1313
Output,
1414
RequestResult: NSFetchRequestResult,
1515
ControllerResult: NSFetchRequestResult
16-
>: BaseSubscription<Output, RequestResult, ControllerResult> where Output: Sendable {
16+
>: BaseSubscription<Output, RequestResult, ControllerResult>, @unchecked Sendable where Output: Sendable {
1717
let continuation: AsyncStream<Result<Output, CoreDataError>>.Continuation
1818

1919
@usableFromInline

0 commit comments

Comments
 (0)