ZenMutationQueue class

Manages the offline mutation queue.

Stores offline mutations and replays them in strict FIFO order when the network returns. Supports bounded retries and a persisted dead-letter queue so permanent errors never deadlock subsequent jobs.

Properties

deadLetterCount → int
Number of permanently failed jobs currently in the dead-letter queue.
no setter
deadLetterJobs → List<ZenMutationJob>
Unmodifiable list of permanently failed jobs awaiting inspection or manual retry.
no setter
hashCode → int
The hash code for this object.
no setterinherited
maxRetries → int
Maximum replay attempts per job before moving to deadLetterJobs.
no setter
pendingCount → int
Get the number of pending mutations in the queue
no setter
pendingJobs → List<ZenMutationJob>
Get a list of pending mutation jobs (for debugging/devtools)
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(ZenMutationJob job) → void
Add a job to the queue
clearDeadLetters() → void
Remove all jobs from the dead-letter queue and persist.
configure({int maxRetries = defaultMaxRetries, ZenMutationRetryPredicate? shouldRetry, ZenMutationDeadLetterCallback? onDeadLetter}) → void
Configure retry and dead-letter behavior for offline queue replay.
init(ZenStorage? storage) → Future<void>
Initialize the queue and restore from storage if available.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process() → Future<void>
Process the queue (replay mutations) in strict FIFO order.
registerHandlers(Map<String, ZenMutationHandler> handlers) → void
Register mutation handlers required for replaying offline mutations.
remove(String id) → void
Remove a job from the queue
reset() → void
Clear all queued jobs, dead-letter jobs, handlers, configuration, storage, and network listener. Called automatically by Zen.reset().
retryDeadLetter(String id) → void
Move a dead-letter job back to the active queue with retryCount: 0 and trigger replay immediately if online.
setNetworkStream(Stream<bool> stream) → void
Set the network stream to listen for connectivity changes.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → ZenMutationQueue
final

Constants

defaultMaxRetries → const int