Module 02 — State versus process
The problem
Process dies
│
▼
What happens to Pico state?
Native (volatile) baseline
With NativeRuntime, state lives only in memory. Restart the process and the count is gone.
Durable requirement
Entity lifetime and process lifetime are different concerns.
| Concept | Meaning |
|---|---|
| Volatile state | Lost when the process ends |
| Durable state | Survives process restart |
| Runtime lifecycle | Start / stop of the executor |
| Entity lifecycle | Logical lifetime of the Pico |
Exercise
- Invoke Hello Pico twice on
NativeRuntime. - Create a new
NativeRuntimeinstance (simulating restart). - Observe that state is gone.
- Contrast with Module 07 (Durable State).