polqf / RealmResultsController

A NSFetchedResultsController implementation for Realm written in Swift
MIT License
188 stars 25 forks source link

Queue manager #46

Closed polqf closed 8 years ago

polqf commented 8 years ago

:tophat: What? Why?

There was an scenario where if the RRC was being accessed from different threads, it was causing unordered calls to willChangeResults and didChangeResults, and this was causing a crash on the collectionView/tableView.

Added RealmQueueManager, which is a wrapper around NSOperationQueue, that is going to prevent this by only executing 1 concurrent operation at a time.

Also added a Environment Variable that is going to prevent the operations to be enqueued while running tests

:ghost: GIF

fegabe commented 8 years ago

Good catch!

isaacroldan commented 8 years ago

:+1:

fegabe commented 8 years ago

:+1:

mariabernis commented 8 years ago

:speech_balloon: and :+1: