From cd82f340b83842ba20986f58db33ea2dd9dd1ce5 Mon Sep 17 00:00:00 2001 From: kean Date: Sun, 18 Aug 2024 13:57:47 -0400 Subject: [PATCH] Remove Sendable conformance from AsyncPipelineTask --- Sources/Nuke/Tasks/AsyncPipelineTask.swift | 2 +- Sources/Nuke/Tasks/AsyncTask.swift | 1 - Sources/Nuke/Tasks/TaskFetchWithClosure.swift | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Sources/Nuke/Tasks/AsyncPipelineTask.swift b/Sources/Nuke/Tasks/AsyncPipelineTask.swift index 2d9cd5a08..1f5d97818 100644 --- a/Sources/Nuke/Tasks/AsyncPipelineTask.swift +++ b/Sources/Nuke/Tasks/AsyncPipelineTask.swift @@ -6,7 +6,7 @@ import Foundation // Each task holds a strong reference to the pipeline. This is by design. The // user does not need to hold a strong reference to the pipeline. -class AsyncPipelineTask: AsyncTask, @unchecked Sendable { +class AsyncPipelineTask: AsyncTask { let pipeline: ImagePipeline // A canonical request representing the unit work performed by the task. let request: ImageRequest diff --git a/Sources/Nuke/Tasks/AsyncTask.swift b/Sources/Nuke/Tasks/AsyncTask.swift index a1c561190..faa1da3e5 100644 --- a/Sources/Nuke/Tasks/AsyncTask.swift +++ b/Sources/Nuke/Tasks/AsyncTask.swift @@ -16,7 +16,6 @@ import Foundation /// @ImagePipelineActor class AsyncTask: AsyncTaskSubscriptionDelegate { - private struct Subscription { let closure: (Event) -> Void weak var subscriber: AnyObject? diff --git a/Sources/Nuke/Tasks/TaskFetchWithClosure.swift b/Sources/Nuke/Tasks/TaskFetchWithClosure.swift index 3d34edb62..7f7fa8996 100644 --- a/Sources/Nuke/Tasks/TaskFetchWithClosure.swift +++ b/Sources/Nuke/Tasks/TaskFetchWithClosure.swift @@ -4,8 +4,6 @@ import Foundation -// TODO: (nuke13) stop inhereting from AsyncPipelineTask - /// Fetches data using the publisher provided with the request. /// Unlike `TaskFetchOriginalImageData`, there is no resumable data involved. final class TaskFetchWithClosure: AsyncPipelineTask<(Data, URLResponse?)> { @@ -28,8 +26,6 @@ final class TaskFetchWithClosure: AsyncPipelineTask<(Data, URLResponse?)> { } } - // TODO: (nuke13) implement in TaskFetchOriginalData using the same protocol - // This methods gets called inside data loading operation (Operation). private func loadData(finish: @escaping () -> Void) { guard !isDisposed else {