filmopen_jobs
Generated by scripts/package_digest.py; regenerate, never edit.
Application-owned jobs, persistence and scheduling, independent of the film and its screens.
pure Dart. 14 files, 1,617 lines under lib/; 106 tests in 20 files. Barrel: lib/filmopen_jobs.dart.
Depends on
Section titled “Depends on”Nothing of FilmOpen.
Used by
Section titled “Used by”filmopen_app, filmopen_cloud, filmopen_drive, filmopen_forms, filmopen_insertion, filmopen_insertion_ui, filmopen_jobs_ui, filmopen_plugin_host, filmopen_render, filmopen_render_ui, filmopen_sharing, filmopen_state, filmopen_sync
Public API
Section titled “Public API”What the barrel exports, file by file. A name is class, enum, mixin, extension, typedef, a top-level function, getter, setter or variable; under a class, its public constructors, fields, getters, setters and methods.
lib/src/job_api.dart — without copyJobData
Section titled “lib/src/job_api.dart — without copyJobData”- enum
JobPhase— The complete set of marks a screen draws (overview §4.1).- values:
queued,working,waiting,needsAttention,done,failed,cancelled
- values:
- class
JobAction— An extensible command: screens send it back without interpreting policy.const JobAction(this.code)final String codestatic const stopstatic const resumestatic const retrystatic const attachAgainstatic const signInstatic const dismissstatic const resumeAnyway
- class
JobView— Everything a widget may know about a job; no persistence or retry details.JobView({required this.id, required this.kind, required this.phase, required this.stateCode, Map<String, String> stateArgs = const {}, this.progres…final String idfinal String kindfinal JobPhase phasefinal String stateCodefinal Map<String, String> stateArgsfinal double? progressfinal Set<JobAction> actionsfinal String? placeKeyfinal String? referencefinal String? previewPathfinal String? displayName
- typedef
typedef JobReport— A diagnostic: a stable code; for a failure the error’s type and message ([describeJobError]), for an event the values it worked on. - function
String describeJobError(Object error)— The error as a report carries it: its runtime type, then its whole text, the type said once. - typedef
typedef JobViews— A screen subscribes to snapshots, without observing an execution record. - enum
JobPersistence— Persistence is chosen by the owner of the request, never by a widget.- values:
session,durable
- values:
- class
JobRequest— Opaque execution data.JobRequest({required this.kind, required this.lane, required Map<String, Object?> payload, this.projectKey, this.placeKey, this.persistence = JobPe…final String kindfinal String lanefinal String? projectKeyfinal String? placeKeyfinal JobPersistence persistencefinal JobHold? holdMap<String, Object?> get payload
- class
JobHold— A policy hold carries its explanation and the commands that can lift it.JobHold(this.code, {Iterable<JobAction> actions = const [JobAction.resume, JobAction.stop]})final String codefinal Set<JobAction> actions
- class
JobCheckpoint— A runner’s next durable intent and explicitly selected, safe view fields.JobCheckpoint({required this.stateCode, Map<String, Object?>? payload, this.phase = JobPhase.working, Map<String, String> stateArgs = const {}, thi…final String stateCodefinal JobPhase phaseMap<String, Object?>? get payloadfinal Map<String, String> stateArgsfinal double? progressfinal Set<JobAction> actionsfinal String? referencefinal String? previewPathfinal String? displayName
- class
JobResult— An attempt’s result.JobResult.done({this.reference, this.previewPath, this.displayName})JobResult.waiting(this.code, {Iterable<JobAction> actions = const [JobAction.stop]})JobResult.needsAttention(this.code, {Iterable<JobAction> actions = const [JobAction.retry, JobAction.dismiss], this.displayName})— A result the person must act on; [displayName] names the file it is about, where there is one.JobResult.failed(this.code)JobResult.retry(this.code, {Duration delay = const Duration(seconds: 5)})JobResult.cancelled()final JobPhase phasefinal String codefinal Set<JobAction> actionsfinal Duration? retryDelayfinal String? referencefinal String? previewPathfinal String? displayName
- class
JobRun— One attempt, with a memory-only binding and a cancellation intent.String get idint get seqMap<String, Object?> get payloadObject? get bindingbool get interruptedJobAction? get requestedActionbool get cancelRequestedFuture<void> get whenCancelledFuture<void> checkpoint(JobCheckpoint next)Future<T> effect<T>(JobCheckpoint intent, Future<T> Function() perform)— Persist intent before an effect; a failed checkpoint performs no effect.
- typedef
typedef JobRunner— Registered per kind, independently of the journal’s private schema. - typedef
typedef BindJob— Reconstructs bindings for an explicitly activated project. - class
JobUnavailable— A refusal named by its code: a job view shows the code, never an underlying store’s message.const JobUnavailable(this.code, [this.detail])final String codefinal String? detail— What the log needs to find the cause, such as the refused payload key’s name; never a value.
- class
JobActionAck— An acknowledgement means the control intent was durably accepted.const JobActionAck(this.accepted, this.code)final bool acceptedfinal String code
lib/src/job_engine.dart
Section titled “lib/src/job_engine.dart”- class
JobEngine— Application-owned execution.factory JobEngine({String? directory, DateTime Function()? now, bool autoTick = true, Map<String, int> capacities = const {}, JobReport? onJournalP…— Creates an inert engine whose exact capacities override the longest trailing-star prefix.void register(String kind, JobRunner runner, {JobRunner? cancel, bool interruptible = false})— [cancel] reconciles a stopped, previously started job under its execution claim.Future<String> submit(JobRequest request, {Object? binding})— Returns the accepted job id after its queued commit even if scheduling fails.Future<void> restore(String? projectKey, {required BindJob bind})List<JobView> get snapshotStream<List<JobView>> get viewsFuture<JobActionAck> act(String id, JobAction action)void holdLane(String lane, JobHold hold)void releaseLane(String lane)Future<void> tick()Future<void> close({Duration grace = const Duration(seconds: 10)})
lib/src/job_record.dart — only refuseCredentialKeys
Section titled “lib/src/job_record.dart — only refuseCredentialKeys”- function
void refuseCredentialKeys(Map payload)— Refuse credential-shaped payload keys without inspecting record fields.
lib/src/producer.dart
Section titled “lib/src/producer.dart”- class
Producer— A producer owns opening its outputs.String get kindFuture<ProducerRun> start(Map<String, Object?> request, Object? context)Future<ProducerRun> restore(Map<String, Object?> saved)
- class
ProducerRun— A producer survives its submitter; acknowledgement comes after safe ingest.Stream<ProducerEvent> get eventsFuture<bool> cancel()— Asks the producer to stop, and answers whether it is over.Map<String, Object?> toJson()Future<void> acknowledge()
- class
ProducerEvent— State/progress followed by produced values or a code-only failure. - class
ProducerState— A producer’s code is localized by its consumer, never server prose.const ProducerState(this.code, {this.progress})final String codefinal double? progress
- class
Produced— A terminal successful answer, preserving the producer’s item order.Produced(Iterable<ProducedValue> items)final List<ProducedValue> items
- class
ProducerFailed— A terminal failure carries no exception, URL or server response.const ProducerFailed(this.code, {this.detail})final String codefinal String? detail— The provider’s own sentence on why, already screened and cut by whoever kept it; carried, never read.
- class
ProducedValue— An output is media bytes or a text proposal; insertion decides its place. - class
ProducedItem— Authorized bytes opened by the producer itself (overview §4).const ProducedItem()String get nameString get mimeint? get lengthMap<String, Object?> get provenanceStream<List<int>> open()
- class
ProducedText— A text proposal, not permission to replace the destination’s current text.const ProducedText(this.text)final String text
Internal
Section titled “Internal”Files under lib/ the barrel does not reach; nothing outside the package may import them.
lib/src/execution_claim.dart:ExecutionClaim,ExecutionClaims,MemoryExecutionClaims,_MemoryClaimlib/src/job_engine_impl.dart:JobEngineImpl,_Runlib/src/journal.dart:Journal,MemoryJournal,JournalProblemlib/src/journal_io.dart:FileJournal,JournalWrites,DiskJournalWrites,atomicWrite,FileLeaseStorelib/src/journal_stub.dart:sessionJournal,sessionLeaseStorelib/src/lease.dart:LeaseState,LeaseStore,MemoryLeaseStore,Leaselib/src/persistence.dart:JobStorage,memoryStoragelib/src/persistence_io.dart:createStorage,FileExecutionClaims,_FileClaimlib/src/persistence_stub.dart:createStorage