FileJobStore class final
A JobStore that writes one JSON file per job under a directory, so jobs and
their download links survive a restart.
Writes are atomic (a temp file is renamed into place). On boot, call
reconcileInterruptedJobs to flip any job left running (the process died
mid-render) to failed.
Constructors
- FileJobStore(Directory dir)
-
Creates a store rooted at
dir(created on demand).
Properties
Methods
-
create(
RenderJob job) → Future< RenderJob> -
Stores a new
joband returns it. -
delete(
String id) → Future< void> -
Deletes the job with
id(idempotent). -
expiredBefore(
DateTime cutoff) → Stream< RenderJob> -
Every job whose
expiresAtis at or beforecutoff, for retention. -
get(
String id) → Future< RenderJob?> -
The job with
id, ornullwhen unknown. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reconcileInterruptedJobs(
) → Future< void> -
Flips every job left in
JobStatus.running(a render the previous process never finished) toJobStatus.failed. -
toString(
) → String -
A string representation of this object.
inherited
-
update(
RenderJob job) → Future< RenderJob> -
Persists an updated
joband returns it.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited