QueueManager<T extends DatumEntityBase> class
Manages the queue of pending synchronization operations for a specific entity type T.
This class acts as a high-level abstraction over the LocalAdapter's queueing mechanism. It provides a simple API to enqueue, dequeue, update, and retrieve pending operations that are waiting to be synchronized with a remote data source.
Constructors
-
QueueManager({required LocalAdapter<
T> localAdapter, required DatumLogger logger}) - Creates a new QueueManager.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
localAdapter
→ LocalAdapter<
T> -
final
- logger → DatumLogger
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
String userId) → Future< void> -
Clears all data for a specific
userId, including pending operations. -
dequeue(
String operationId) → Future< void> -
Removes a synchronization operation from the queue by its
operationId. -
dispose(
) → Future< void> - Disposes of any resources held by the queue manager.
-
enqueue(
DatumSyncOperation< T> operation) → Future<void> -
Adds a new synchronization
operationto the queue for its user. -
getPending(
String userId) → Future< List< DatumSyncOperation< >T> > -
Retrieves a list of all pending synchronization operations for a given
userId. -
getPendingCount(
String userId) → Future< int> -
Returns the number of pending synchronization operations for a given
userId. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
DatumSyncOperation< T> operation) → Future<void> -
Updates an existing synchronization
operationin the queue.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited