DVDatabaseScheduleLease class final
A DVScheduleLease on the application's database, for a deployment whose processes share one but no cache store with compare-and-set.
A claim is a row whose primary key is the occurrence -- the task and the instant the schedule named, in UTC -- so the database's own uniqueness decides between two processes inserting it at once, on Postgres, MySQL and a SQLite file alike. An insert that fails is a lost claim only when the row is there afterwards; anything else is a database that cannot be reached and is rethrown, so the scheduler records it and runs nothing.
Held for hold like DVCacheScheduleLease, and never released. A SQLite file is shared by the processes of one host only: cron processes on two hosts need a database both reach.
- Implemented types
Constructors
- DVDatabaseScheduleLease(DVDatabaseAdapter database, {String tableName = 'dartvel_schedule_leases', Duration hold = const Duration(days: 2)})
Properties
- database → DVDatabaseAdapter
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hold → Duration
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tableName → String
-
final
Methods
-
claim(
String task, DateTime occurrence) → Future< bool> -
Claims
occurrenceoftask. True for exactly one claimant across every process sharing the lease's store; false for the rest.override -
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