Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

segiddins
Copy link
Contributor

Closes #1097.

@segiddins segiddins added the pr label Jul 27, 2015
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];
Copy link
Contributor

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.

Copy link
Contributor Author

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

@jpsim
Copy link
Contributor

jpsim commented Jul 27, 2015

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 throws in the Swift 2 case.

@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;
Copy link
Member

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.

@segiddins
Copy link
Contributor Author

Closing this because it's probably the wrong approach and a gross misuse of the Core APIs.

@segiddins segiddins closed this Aug 24, 2015
@segiddins segiddins removed the pr label Aug 24, 2015
@bmunkholm bmunkholm deleted the seg-handover branch March 12, 2019 13:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confine on dispatch queue rather than thread
3 participants