RequestSqliteCacheManager<RequestMethod> class
abstract
Fetch and delete RequestSqliteCaches.
Constructors
- RequestSqliteCacheManager(String databaseName, {required String createdAtColumn, required DatabaseFactory databaseFactory, required String lockedColumn, required String primaryKeyColumn, Duration? processingInterval, bool serialProcessing = true, required String tableName, required String updateAtColumn})
Properties
- createdAtColumn → String
-
The file name for the database used.
final
- databaseFactory → DatabaseFactory
-
Access the SQLite,
instance agnostically across platforms.
final
- databaseName → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lockedColumn → String
-
final
- orderByStatement → String
-
no setter
- primaryKeyColumn → String
-
final
- processingInterval → Duration
-
Time between attempts to resubmit a request. Defaults to 5 seconds.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serialProcessing → bool
-
When
true
, results are processed one at a time in the order in which they were created. Defaultstrue
.final - tableName → String
-
final
- updateAtColumn → String
-
final
Methods
-
deleteUnprocessedRequest(
int id) → Future< bool> -
Delete job in queue. This is a destructive action and cannot be undone.
id
is retrieved from the primaryKeyColumn. -
getDb(
) → Future< Database> -
migrate(
) → Future< void> - Prepare schema.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prepareNextRequestToProcess(
) → Future< RequestMethod?> - Discover most recent unprocessed job in database convert it back to an HTTP request. This method also locks the row to make it idempotent to subsequent processing.
-
sqliteToRequest(
Map< String, dynamic> data) → RequestMethod? -
Builds a client-consumable
RequestMethod
from SQLite row output -
toString(
) → String -
A string representation of this object.
inherited
-
unprocessedRequests(
{bool onlyLocked = false}) → Future< List< Map< >String, dynamic> > - Returns row data for all unprocessed job in database. Accessing this list can be useful determining queue length.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited