New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add readBlock to objectForKey & writeBlock to setObject:forKey: #6
Conversation
Thanks for the contribution! Would you be willing to split this up into multiple pull requests (e.g. one that adds |
@jparise should I remove nullability attributes and then make a diff branch with them? |
Yes, that would be my preference. @garrettmoon is the primary maintainer, though, so let's see what he says. |
Hi Dima, Thanks so much for the contribution! I agree with Jon that splitting this up into multiple pull requests will make it easier to review and merge in. If you're willing to do that, it would be greatly appreciated! On Mon, Jun 8, 2015 at 9:55 AM, Jon Parise notifications@github.com
|
I'll do my best tomorrow's morning ;) |
Sorry, @garrettmoon, I'm a bit busy atm, so waiting for the weekends |
Hey, no worries! |
Guys, having a really crazy pre-release weeks, sorry one more time |
@garrettmoon I reverted nullability attributes, check it! |
Thanks! I'll give this another look by EOD Friday. |
@@ -124,6 +140,18 @@ typedef void (^PINCacheObjectBlock)(PINCache *cache, NSString *key, id __nullabl | |||
- (void)setObject:(id <NSCoding>)object forKey:(NSString *)key block:(nullable PINCacheObjectBlock)block; | |||
|
|||
/** | |||
Stores an object in the cache for the specified key. This method returns immediately and executes the | |||
passed block after the object has been stored, potentially in parallel with other blocks on the <queue>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be concurrentQueue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-paste got me :)
This looks good! Aside from the few nits above, there's one other thing I'd request: many of the changes are whitespace changes that seem unnecessary and conflict with the existing whitespace patterns. Do you mind cleaning this up? |
@garrettmoon |
@garrettmoon feature/object_at_path - allows you to set object at path. This is useful, when object is relatively big, so instead of explicit read and write NSFileManager used to simply copy / move file. feature/trim_by_keys - this one is quite specific. It allows you to trim a defined set of keys to some date (heavily used in my current project cleanup of unused key with specific criteria) |
BlueprintName = "iOS" | ||
ReferencedContainer = "container:PINCache.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? What does it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange why it gets commited.
I was trying to run tests from iOS target by cmd+u, however this one should be reverted..
@dimazen Nice! And if you feel that the features would be widely useful to others, feel free to submit pull requests. One more question and I think we're there! |
I think I dropped the ball on this. The last question was, can you reformat your patch so it doesn't include all the whitespace changes? I know this is a pain, but it will help keep our git history. Thank you in advance! |
Argh, I've totally forgot about it, sure I will with no questions ;) |
Just to keep things clean, I'm going to close this. Feel free to reopen if you'd like to continue working on it. |
Or rather, let me know if you'd like to reopen :) |
Generally this is a merge of https://github.com/tumblr/TMCache/pull/30/commits to PINCache.
Read & Write blocks are quite useful when object isn't compatible with NSCoding or manual action needs to be performed