-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[RLMResults][Results] Add handover to a target dispatch queue #2300
Conversation
RLMRealm *createWithRealmCreation(RealmCreation realmCreation, SharedGroup::VersionID version) { | ||
try { | ||
NSError *realmCreationError = nil; | ||
RLMRealm *realm = [RLMRealm realmWithPath:realmCreation.path key:realmCreation.key readOnly:realmCreation.readOnly inMemory:realmCreation.inMemory dynamic:realmCreation.dynamic schema:realmCreation.schema error:&realmCreationError]; |
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.
we probably want to pass nil
for the error pointer here so that we throw if the realm can't be created.
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.
No, we specifically dont want to throw since we're on a background thread
The one thing that we're not doing here is error handling. I think it's worth the ability to pass in an NSError pointer in the public API and using |
@param queue The dispatch queue onto which the results should be delivered. | ||
@param block The block to be called on the given `queue` with the queue-local copy of the results. | ||
*/ | ||
- (void)deliverOnQueue:(dispatch_queue_t)queue block:(void (^)( RLMResults RLM_GENERIC_RETURN * __nullable , NSError * __nullable ))block; |
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.
Maybe just deliverOn:
?
There's some extra whitespace here.
Closing this because it's probably the wrong approach and a gross misuse of the Core APIs. |
Closes #1097.