mirror of https://github.com/dapr/docs.git
update acquire lock dotnet
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
parent
6d3f537f2f
commit
15cf08d038
|
@ -62,12 +62,14 @@ namespace LockService
|
|||
{
|
||||
class Program
|
||||
{
|
||||
[Obsolete("Distributed Lock API is in Alpha, this can be removed once it is stable.")]
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
string DAPR_LOCK_NAME = "lockstore";
|
||||
string fileName = "my_file_name";
|
||||
var client = new DaprClientBuilder().Build();
|
||||
|
||||
using (var fileLock = await client.Lock(DAPR_LOCK_NAME, "my_file_name", "random_id_abc123", 60))
|
||||
|
||||
await using (var fileLock = await client.Lock(DAPR_LOCK_NAME, fileName, "random_id_abc123", 60))
|
||||
{
|
||||
if (fileLock.Success)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue