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
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
jobforowneruntilnow+lease:nullif another owner holds it (not expired). An expired lock is taken over; a lock ofowneris renewed. -
claimRun(
APICronJobRun run) → FutureOr< APICronJobRun?> -
Inserts
run, claiming its occurrence:nullif the occurrence already has a run (another instance claimed it). -
deleteRunsBefore(
String job, DateTime before) → FutureOr< int> -
Deletes the finished runs of
jobscheduled beforebefore(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
scheduledAtofjob, if any. -
lastRun(
String job) → FutureOr< APICronJobRun?> -
The run of
jobwith 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
lockuntilnow+lease:falseif it's no longer held by its owner (lost: expired and taken over). -
selectRunningRuns(
String job) → FutureOr< List< APICronJobRun> > -
The runs of
jobwith status APICronRunStatus.running. -
selectRuns(
String job, {int limit = 20}) → FutureOr< List< APICronJobRun> > -
The latest runs of
job(latest first), at mostlimit. -
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 bypreviousOwner(default: the APICronJobRun.owner ofrun; another owner when taking an interrupted run over).falseotherwise: 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