You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add set_multi_cas for per-key CAS return from batched writes
set_multi's current return shape is a list of failed keys, which can't
carry a per-key CAS value. It also uses the quiet setq/addq opcodes,
which intentionally suppress successful responses -- so even if the
shape allowed it, the wire protocol wouldn't return a CAS per key.
Add a separate `set_multi_cas` method that uses the non-quiet set/add
opcodes (one response per key) and returns `{str_key: int | None}` for
every input key -- int on success, None on failure. The existing
`{(key, cas): value}` input syntax from set_multi is preserved; the
result dict is keyed by the string key regardless of which form was
passed.
For ReplicatingClient, set_multi_cas raises NotImplementedError when
the client has more than one server, for the same reason as the
single-key get_cas=True surfaces: each replica has its own CAS
counter, so any per-key value we returned would be unsafe to feed
back to cas(). Single-server ReplicatingClient and DistributedClient
work normally.
0 commit comments