Add cancel method for PINRemoteImageManager - #509
Conversation
|
🚫 CI failed with log |
|
Please add tests. |
|
Hmm, I'm not sure this will work. If the UUIDs are stored in a weak hash table, PINRemoteImageManager will 'lose' references to requests that the caller doesn't strongly retain the UUID to… |
|
@garrettmoon 🤔 Emm, |
|
@garrettmoon And I may have a thought to optimize |
You're right! Would you mind adding a comment to the code saying as much? |
Seems like a good optimization because it will also make the code clearer I think! |
👌 I'll make a PR later~ |
garrettmoon
left a comment
There was a problem hiding this comment.
Thank you for your contribution here!
| } | ||
| [task addCallbacksWithCompletionBlock:completion progressImageBlock:progressImage progressDownloadBlock:progressDownload withUUID:UUID]; | ||
| [self.tasks setObject:task forKey:key]; | ||
| // Relax :), task retain the UUID for us, it's ok to have a weak reference to UUID here. |
Add cancel all tasks for
PINRemoteImageManager, it's the convenience method for user to call all tasks one shot, don't need to maintain uuids by themself.