Skip to content

IOS-3084: Feature/Ensure thread safety#7

Merged
khaptonstall merged 2 commits intomainfrom
feature/thread-safety
Nov 29, 2021
Merged

IOS-3084: Feature/Ensure thread safety#7
khaptonstall merged 2 commits intomainfrom
feature/thread-safety

Conversation

@khaptonstall
Copy link
Contributor

Issue Link
https://spothero.atlassian.net/browse/IOS-3084

Description
Updated all methods which perform work on an NSManagedObjectContext to ensure thread safety by using the MOC's thread to do the work (i.e. through the performAndWait {} block).

performAndWait was used over the asynchronous perform method to better match the existing method signatures (as none of them accept completion block arguments).

Adding support for better control over which type of work is performed (synchronous vs asynchronous) and leveraging Swift Concurrency are captured in upcoming tickets.

All methods will use the synchronous performAndWait, which coincides with their method signatures (i.e. they don't currently accept completion blocks).
@khaptonstall khaptonstall requested a review from a team as a code owner November 23, 2021 19:15
@lquigley lquigley self-assigned this Nov 24, 2021
lquigley
lquigley previously approved these changes Nov 24, 2021
@github-actions
Copy link

3 Messages
📖 Formatted with SwiftFormat v0.48.18.
📖 Linted with SwiftLint v0.41.0.
📖 👋 👋 Great job!

Generated by 🚫 Danger

@khaptonstall khaptonstall merged commit d5c2d72 into main Nov 29, 2021
@khaptonstall khaptonstall deleted the feature/thread-safety branch November 29, 2021 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants