@@ -250,6 +250,12 @@ extension ValueConcurrentObserver {
250
250
// transaction to complete.
251
251
//
252
252
// Fetch value & tracked region in a synchronous way.
253
+ //
254
+ // TODO: we currently perform the initial read from a snapshot, because
255
+ // it is a handy way to keep a read transaction open until we grab a
256
+ // write access, and compare the database versions. The problem is that
257
+ // we do not control the number of created shapshots: we should instead
258
+ // use a reader from the pool.
253
259
let initialSnapshot = try databaseAccess. dbPool. makeSnapshot ( )
254
260
let ( fetchedValue, initialRegion, initialWALSnapshot) = try initialSnapshot. read {
255
261
db -> ( Reducer . Fetched , DatabaseRegion , WALSnapshot ? ) in
@@ -299,6 +305,12 @@ extension ValueConcurrentObserver {
299
305
// for observing the database is to be able to fetch the initial value
300
306
// without having to wait for an eventual long-running write
301
307
// transaction to complete.
308
+ //
309
+ // TODO: we currently perform the initial read from a snapshot, because
310
+ // it is a handy way to keep a read transaction open until we grab a
311
+ // write access, and compare the database versions. The problem is that
312
+ // we do not control the number of created shapshots: we should instead
313
+ // use a reader from the pool.
302
314
do {
303
315
let initialSnapshot = try databaseAccess. dbPool. makeSnapshot ( )
304
316
initialSnapshot. asyncRead { dbResult in
0 commit comments