Skip to main content

apply_data_inputs

Function apply_data_inputs 

Source
pub async fn apply_data_inputs(
    workload: &Path,
    inputs: &BTreeMap<String, Value>,
) -> Result<(), Error>
Expand description

Write a poke’s carried inputs into the workload, replacing whatever this node’s own feed sidecar last left there.

Overwriting is the point: after this, the render reads the poke’s data rather than node-local state, so every instance produces the same output for the same poke. It also makes the node self-healing — a node that was down for three releases is correct on the first poke it receives, without waiting for its sidecar to catch up.

Written with to_string_pretty, matching the producer’s own serialization. The bytes are not guaranteed identical to the producer’s (a JSON object round-trips with sorted keys, a struct serializes in declaration order), but every consumer of these files parses them, and the sidecar’s own change-detection compares parsed values — so a key reorder cannot manufacture a phantom change.