APICronStore class abstract

The storage of the APICronScheduler: the runs of each occurrence and the locks of the jobs. See APICronStoreMemory and APICronStoreDB.

Implementers

Constructors

APICronStore()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

acquireLock(String job, String owner, Duration lease, {DateTime? now}) → FutureOr<APICronJobLock?>
Acquires the lock of job for owner until now + lease: null if another owner holds it (not expired). An expired lock is taken over; a lock of owner is renewed.
claimRun(APICronJobRun run) → FutureOr<APICronJobRun?>
Inserts run, claiming its occurrence: null if the occurrence already has a run (another instance claimed it).
deleteRunsBefore(String job, DateTime before) → FutureOr<int>
Deletes the finished runs of job scheduled before before (never a APICronRunStatus.running one: it may be resumed). Returns the count.
getLock(String job) → FutureOr<APICronJobLock?>
The lock of job, if any.
getRun(String job, DateTime scheduledAt) → FutureOr<APICronJobRun?>
The run of the occurrence scheduledAt of job, if any.
lastRun(String job) → FutureOr<APICronJobRun?>
The run of job with the latest APICronJobRun.scheduledAt.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
releaseLock(APICronJobLock lock) → FutureOr<bool>
Releases lock (only if still held by its owner).
renewLock(APICronJobLock lock, Duration lease, {DateTime? now}) → FutureOr<bool>
Renews lock until now + lease: false if it's no longer held by its owner (lost: expired and taken over).
selectRunningRuns(String job) → FutureOr<List<APICronJobRun>>
The runs of job with status APICronRunStatus.running.
selectRuns(String job, {int limit = 20}) → FutureOr<List<APICronJobRun>>
The latest runs of job (latest first), at most limit.
toString() → String
A string representation of this object.
inherited
updateRun(APICronJobRun run, {String? previousOwner}) → FutureOr<bool>
Updates the stored run, only if the stored one is still APICronRunStatus.running and owned by previousOwner (default: the APICronJobRun.owner of run; another owner when taking an interrupted run over). false otherwise: the run was taken over by another instance, finished or deleted, and must not be overwritten.

Operators

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