Skip to main content

Locking

Why you need it

Concurrent Steps and RPCs must not corrupt shared Attributes.

Code examples

Choose an SDK (preference is sticky in this browser; default Python).

# StepOptions: execute_lock_attribute_keys=["balance"]
# RPC: lock_attribute_keys=["balance"]

Declare lock attribute keys on Step options and RPC invocations.

How Dex implements it

Dex serializes access to locked Attributes for WaitFor/Execute/RPC critical sections.

Traditional workarounds

Without Dex: SELECT FOR UPDATE, Redis locks, or “hope” — with unclear ownership across services.