Represents a value that is persisted via a file-based backing store.
initial_value: Any, filename: str, write_value: bool = True
The value must be JSON-serializable. Each time the value is updated, it will
be written to the backing file. It is only read from the file at
The initial value to use if no backing file exists or was
given. This must be a JSON-serializable value (possibly nested
combination of lists, dicts, and primitive values).
The path to use for persistent storage of the value. This may be
None, in which case the value is not stable across preemptions.
True, new values will be written to
filename on calls
filename is only read once to restore any
persisted value, and new values will not be written to it. This can be
useful in certain multi-client settings to avoid race conditions or
excessive file writes. If
None, this parameter has no
Returns the value.
Writes the value, updating the backing store if one was provided.