This repository has been archived by the owner on Jun 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Why not return to the main thread after constructing a stack ? #123
Labels
Comments
While in many cases you may want to work with your Stack on the main thread after setup, this is not a universal situation. I do think we could simplify the setup by including a parameter to specify the callback queue similar to how |
@zwaldowski curious about your opinion on this one also. |
Providing a queue would be fine but I think pushing to the main thread is an API design crutch. |
CoreDataStack API design crutch or app level API design crutch? |
Er, both. |
Added in v1.2.4 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It is pretty common inside a TableViewController's
init
orviewDidLoad
method to have initialisation code like the following:This code will crash however because the callback is executed on a background thread (created by
setupSQLiteBackedCoordinator
.Unless I missed something, it seems to me it would be less confusing if the callback was executed on the main thread. After all, once the stack has been set up why remain in the background thread?
A pretty simple fix would be to just wrap the
callback
calls insideconstructSQLiteStack
:The text was updated successfully, but these errors were encountered: