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

dir Directory
The directory holding <id>.json job files.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

create(RenderJob job) Future<RenderJob>
Stores a new job and returns it.
delete(String id) Future<void>
Deletes the job with id (idempotent).
expiredBefore(DateTime cutoff) Stream<RenderJob>
Every job whose expiresAt is at or before cutoff, for retention.
get(String id) Future<RenderJob?>
The job with id, or null when 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) to JobStatus.failed.
toString() String
A string representation of this object.
inherited
update(RenderJob job) Future<RenderJob>
Persists an updated job and returns it.

Operators

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