mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
[Question] is Async Transaction is thread safe? #315
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 @seanliu1 on GitHub (Feb 19, 2020).
I have a question regarding perform async function, I looked into the source code, but still not very clear for me. Here are code samples.
in the second group.enter, if we fetchOne, can we get the object we just inserted.
@JohnEstropia commented on GitHub (Feb 20, 2020):
No, you can't. As the method name suggests, that is an asynchronous transaction. In fact, transactions run a serial asynchronous queue, so you don't really need your
DispatchGroupthere.You can fetch the first created
Personfrom inside the first transaction'scompletion, and also from inside the second transaction'sasynchronousclosure.@seanliu1 commented on GitHub (Feb 20, 2020):
Thanks, sorry I mean in the second transaction's async closure.