Exemple #1
0
 private void RefreshStatistics()
 {
     asyncDatabaseCommands
     .GetStatisticsAsync()
     .ContinueOnSuccess(stats =>
     {
         Statistics.Value = stats;
     });
 }
Exemple #2
0
 private void RefreshStatistics()
 {
     asyncDatabaseCommands
     .GetStatisticsAsync()
     .ContinueOnSuccess(stats =>
     {
         Statistics.Value = stats;
         Status.Value     = "Online";
         //  ApplicationModel.Current.Server.Value.IsConnected.Value = true;
     })
     .Catch(exception =>
     {
         Status.Value = "Offline";
         //  ApplicationModel.Current.Server.Value.IsConnected.Value = false;
     });
 }
Exemple #3
0
        protected bool WaitForIndexToReplicate(IAsyncDatabaseCommands commands, string indexName, int timeoutInMilliseconds = 1500)
        {
            var mre = new ManualResetEventSlim();

            hasWaitEnded = false;
            Task.Run(async() =>
            {
                while (hasWaitEnded == false)
                {
                    var stats = await commands.GetStatisticsAsync().ConfigureAwait(false);
                    if (stats.Indexes.Any(x => x.Name == indexName))
                    {
                        mre.Set();
                        break;
                    }
                    Thread.Sleep(25);
                }
            });

            var success = mre.Wait(timeoutInMilliseconds);

            hasWaitEnded = true;
            return(success);
        }
Exemple #4
0
 protected override Task <DatabaseStatistics> GetStats()
 {
     return(commands.GetStatisticsAsync());
 }
Exemple #5
0
 public override Task TimerTickedAsync()
 {
     return(asyncDatabaseCommands
            .GetStatisticsAsync()
            .ContinueOnSuccess(stats => Statistics.Value = stats));
 }
Exemple #6
0
 private Task RefreshStatistics()
 {
     return(asyncDatabaseCommands
            .GetStatisticsAsync()
            .ContinueOnSuccessInTheUIThread(s => Statistics.Value = s));
 }