Skip to content

Commit

Permalink
Remove Sendable conformance from AsyncPipelineTask
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Aug 18, 2024
1 parent 97c3ccd commit cd82f34
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/Nuke/Tasks/AsyncPipelineTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Value: Sendable>: AsyncTask<Value, ImagePipeline.Error>, @unchecked Sendable {
class AsyncPipelineTask<Value: Sendable>: AsyncTask<Value, ImagePipeline.Error> {
let pipeline: ImagePipeline
// A canonical request representing the unit work performed by the task.
let request: ImageRequest
Expand Down
1 change: 0 additions & 1 deletion Sources/Nuke/Tasks/AsyncTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Foundation
///
@ImagePipelineActor
class AsyncTask<Value: Sendable, Error: Sendable>: AsyncTaskSubscriptionDelegate {

private struct Subscription {
let closure: (Event) -> Void
weak var subscriber: AnyObject?
Expand Down
4 changes: 0 additions & 4 deletions Sources/Nuke/Tasks/TaskFetchWithClosure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?)> {
Expand All @@ -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 {
Expand Down

0 comments on commit cd82f34

Please sign in to comment.