SyncQueueStore class
Backing store for the persistent sync queue.
Not exported from the package barrel — the store is an implementation detail of DbContext. Use DbContext.pendingSyncChanges to read the queue from application code.
Constructors
- SyncQueueStore({required AsyncQueryProvider provider, int maxQueueSize = 10000})
-
Creates a store that writes to
provider's underlying connection. The provider is expected to be the same one that handles the data writes, so INSERTs into the queue table participate in the caller's transaction.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxQueueSize → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearAll(
) → Future< void> - Deletes every row in the queue. Called from DbContext.syncAsync after a successful round-trip. Must be called in a transaction (so the delete is atomic with the caller's other bookkeeping).
-
count(
) → Future< int> - Returns the number of rows currently in the queue. Cheap (no row materialisation).
-
enqueue(
SyncChange change) → Future< int> -
Inserts
changeinto the queue. Must be called inside a transaction that is also the transaction the data write happened in (or in its own transaction if there is no data write). Returns the new row id. -
loadAll(
) → Future< List< SyncChange> > -
Returns all queued changes in insertion
order. Used by the
DbContexton startup to rehydrate the in-memory cache, and bysyncAsyncif the cache is empty (e.g. the process was restarted before any localsaveChangesAsynchappened). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited