mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 07:33:28 +01:00
Concurrent Cetching From CoreStore Async #188
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SlinToWin on GitHub (Nov 15, 2017).
Use Case:
One Site in my App has two Data Models, one with many entries, one with a few.
When issuing a fetch on both of them on start, the heavy fetch blocks the small fetch because all transactions on CoreStore is done in a serial background queue.
Is there a way to concurrent fetch Data from Core Store asynchronous?
@JohnEstropia commented on GitHub (Nov 21, 2017):
Just to clarify, your two fetches are both from inside transactions, correct?
If your two data models are unrelated to each other, I recommend separating their DataStack (and files). This way each model will have their own serial transactions.
The safety of CoreStore's transactions lie on the serial execution. If you wish to bypass this safety you can use a unsafe transactions (
dataStack.beginUnsafe()) you can use freely on any queue. At that point, you are on your own with thread management.@SlinToWin commented on GitHub (Dec 9, 2017):
Yeah this is correct.
My thought was only some sort of concurrent read access, but sure there must be some sync managment. I have worked around that issue so i close this one. Thanks for your help.