Expand description
In-process workflow simulation, used by orbit test and orbit simulate.
The Simulator runs the real Engine over an in-memory store with a
manual clock. It acts as the worker for every task (asking a
TaskHandler for each result), starts child workflows like the server
does, sends signals as soon as the execution waits for them, and advances
durable time (sleeps, retry backoff, timeouts) straight to the next
wake-up whenever nothing else can happen, so simulations finish instantly
and deterministically.
Structs§
- Mock
Handler - The worker used by
orbit test: answers from the test’s mocks. - Sample
Handler - The worker used by
orbit simulate: fixed results and failures by task name, and a generated sample for every other task. - Simulated
Execution - One execution of a finished simulation.
- Simulation
- Simulator
- Task
Call - One task handed to the simulated worker.
- Test
Result - The outcome of one test.
Enums§
- Task
Outcome - What the simulated worker does with one task.
Constants§
- ROOT_
EXECUTION_ ID - Id of the execution a simulation starts (children get derived ids).
- SIMULATION_
EPOCH_ MS - Simulated time starts at 2026-01-01T00:00:00Z.
Traits§
Functions§
- run_
test - Run one compiled test against
workflows(which must include the tested workflow and its children). - sample_
value - A deterministic, type-valid sample value (used by
orbit simulatefor tasks without a mock).nameis the field the value is for. - simulate
- Run
workflowonce withhandleracting as every worker.