Distributed Lock
With the Dapr Distributed Lock package, you can create and remove locks on resources to manage exclusivity across
your distributed applications. The DaprDistributedLockClient provides a dedicated client for interacting with Dapr’s
distributed lock API, supporting lock acquisition with automatic release on disposal, configurable timeouts, and
cancellation.
Package guidance
While this capability is implemented in both theDapr.Client and Dapr.DistributedLock packages, the approach differs
slightly between them. It’s recommended that new
implementations use the Dapr.DistributedLock package.Core concepts
- How to: Use the Distributed Lock client: install the package, register the client with dependency injection or build it manually, and try the samples.
- DaprDistributedLockClient usage: lifetime management, builder configuration, environment variables, gRPC channel options, cancellation, and the three dependency injection overloads.