You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
703 B
C#

using Dapr.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommonExtend
{
public static class DaprExtend
{
public static bool Completed = false;
public static Task WaitComplete(this DaprClient daprClient) {
while (!daprClient.CheckHealthAsync().Result) {
Thread.Sleep(1000);
}
daprClient.WaitForSidecarAsync().Wait();
if (Completed)
{
return Task.CompletedTask;
}
Thread.Sleep(3000);
Completed = true;
return Task.CompletedTask;
}
}
}