thisRealm is the synchronized MongoDB I got from asyncOpen.
let rc = thisRealm.configuration
let rq = DispatchQueue(label: “readQueue”, qos: .userInteractive, autoreleaseFrequency: .workItem)
let readRealm: RealmSwift.Realm // not defined yet.
readRealm = try! Realm(configuration: rc, queue: rq)
In the Xcode quick help
A configuration value to use when creating the Realm.
An optional dispatch queue to confine the Realm to. If given, this Realm instance can be used from within blocks dispatched to the given queue rather than on the current thread.
- On one hand, the documentation in this Quick Help seems to indicate that I can create one realm and use it in any block dispatched to that queue.
- On the other hand, according to Apple, serial dispatch queues are not guaranteed to use the same thread each time they are used.
Am I tempting Realm fatalErrors if I try to use readRealm in multiple serial dispatch blocks? If so, what is the point of the initializer with the queue parameter?