PersistentQueue class

A PersistentQueue stores data via push and clears it via flush calls.

Constructors

PersistentQueue(String filename, {int flushAt = 100, Duration flushTimeout = const Duration(minutes: 5), int maxLength, String nickname, FutureOr onFlush(List)})
Constructs a new PersistentQueue or returns a previously cached one.
factory

Properties

filename String
Permanent storage extensionless destination filename.
final
hashCode int
The hash code for this object.
read-onlyinherited
length Future<int>
Actual queue length after buffered operations go through.
read-only
nickname String
Optional queue name/alias for debug purposes, defaults to filename.
final
ready Future<void>
Flag indicating queue readiness after initial reload event.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

clear() Future<List>
Clear the list and return queued items.
destroy() Future<void>
Dispose all queue resources.
flush([FutureOr onFlush(List)]) Future<void>
Schedule a flush instruction to happen after current task buffer clears.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
push(dynamic item) Future<void>
Push an item to the end of the PersistentQueue after buffer clears.
toList() Future<List>
Preview a List of currently buffered items, without any dequeuing.
toString() String
A string representation of this object.
inherited

Operators

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