Write and WriteFailed
A Write is one backend write a Change carries out, kept as data. The
writes run in order after the caller says yes, through the operation’s own
apply() or the service’s writes_with() writer. A
change’s writes are fixed once it’s read back; a later amendment builds a new change.
Raise WriteFailed from a writer when the backend refuses a write. The change stops at
that write, the writes before it stay made, and the model is told what went through.
While a write runs, call.write_key is unique to it within the call,
for backends that take an idempotency key.
Write
Parameters
name
Positional-only. What the write does, such as the backend call’s name.
**args
The write’s arguments, available as write.args.
Methods
to_dict() returns {"name": ..., "args": {...}}, and the class method
from_dict(data) builds a Write from that form. Two writes are equal when their
names and arguments are.
WriteFailed
Parameters
reason
Why the backend refused the write, in words the caller can hear. Available as
.reason.