04. Workflow and Async Runtime
This module explains the hardest part of the workstation: not a single async method, but the coordination of state, workflow, background services, cancellation, streaming, and UI projection.
Instead of keeping everything in one long page, this topic is now split into smaller learning units:
- Why Runtime Coordination Is Hard
- Central App State and Workflow Ownership
- Stop, Abort, Fault, and Cancellation
- Streaming, Backpressure, and UI Responsiveness
- Code Tour, Mistakes, and Exercises
Why This Module Matters
This repo is a good teaching system because it contains the kinds of runtime problems that appear in real industrial desktop software:
- multiple background producers
- explicit machine and workflow states
- different termination modes
- bounded pipelines
- UI thread affinity
- durable terminal outcomes
The key idea behind the whole module is simple:
- the runtime stays understandable because the repo separates state ownership, orchestration, background consumption, and UI projection
Quick Runtime Ownership Sketch
Operator
|
v
MainWindow -> MainViewModel -> WorkflowService
| |
| +--> Motion / Camera / Fault paths
| |
v v
CommandGuards AppStateStore <- TelemetryPipelineService
| ^ <- FramePipelineService
+--------------> AppState
|
v
WPF UIThis is the core runtime story of the repo: commands and background work meet in the application layer, then become one canonical state that the UI projects.
Best Reading Order
If you are new to the repo, read the pages in order.
If you already understand the overall architecture, jump directly to:
- page
02for state and ownership - page
03for operational semantics - page
04for streaming and responsiveness
Pair This With
- Scenario 01: Happy Path Inspection Run
- Scenario 02: Stop Versus Abort
- Scenario 03: Fault Injection and Recovery
- 04. Workflow and State Model
- 05. Runtime Sequences
Read Next
After this module, the best next page is:
Diagram Brief
Title: Workflow and async runtime overviewPurpose: Provide one top-level map of state ownership, orchestration, pipelines, and UI projection before the learner goes into the detailed pagesAudience: newcomer developer or automation engineerNodes: MainWindow, MainViewModel, CommandGuards, AppStateStore, AppState, WorkflowService, TelemetryPipelineService, FramePipelineService, FaultInjector, MotionController, CameraControllerEdges: UI commands flow into workflow orchestration; orchestration and pipelines update canonical state; guards read canonical state; the view model projects state to the UI threadGrouping: UI layer, application runtime core, background producers, infrastructure seamsCaption: The runtime stays teachable because responsibility is separated even though the system is highly statefulDestination file path:docs/diagrams/source/course-04-runtime-overview.drawio