-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Helper Function for passing managed objects between threads #5
Conversation
…tThread rather than defaultContext. Fixed compiler warning for ARLog when used in a class method.
Here's some further integration for contextForThread if interested. I haven't kicked the tires too hard though, but the change seems pretty simple. Only further integration I could see is the block functions, but to be honest, I like the block functions using a fresh context for operations. Thanks a ton for this library. |
Here's a bug fix. The deleteEntity one is a bad one, drove me nuts trying to figure out why my bindings were all borked on deletion. Also, I'm looking at error handling and it would be great to be able to route errors to the completion block of the helper as well as a generic handler ala delegation or notification. I'll marinate on it for a few, but thought I'd see what you think. |
Thanks for fixing that. I've been rather busy with other projects and haven't had a whole lot of time to test out your change...I do intend on pulling it though :) |
No worries. I'm integrating this into a mac app, so I'll continue patching On Sun, Apr 10, 2011 at 3:18 PM, casademora <
|
I have, but, since it's all NDA, I'm not allowed to comment here :) You'll be seeing more from me when it is made public. |
Hah, no worries although I'm in the beta too. I have another fix coming for NSFileManager. Changed to from On Mon, Apr 11, 2011 at 9:40 AM, casademora <
|
Added a Managed Object Proxy function to help pass Managed Objects between threads:
[ActiveRecordHelpers performSaveDataOperationInBackgroundWithBlock:^(NSManagedObjectContext *context) {
[[managedObject inContext:context] doAnExpensiveOperation];
}];
Seems to work well, but 2 concerns:
I'm calling [managedObject objectID] off of managedObjects thread. Does not seem like an issue and hasn't caused a problem but is not explicitly recommended.
Error handling is minimal. I just log an error at the moment.
Would appreciate your thoughts!