Ejemplo n.º 1
0
 private void RefreshStatistics()
 {
     asyncDatabaseCommands
     .GetStatisticsAsync()
     .ContinueOnSuccess(stats =>
     {
         Statistics.Value = stats;
     });
 }
Ejemplo n.º 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;
     });
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 protected override Task <DatabaseStatistics> GetStats()
 {
     return(commands.GetStatisticsAsync());
 }
Ejemplo n.º 5
0
 public override Task TimerTickedAsync()
 {
     return(asyncDatabaseCommands
            .GetStatisticsAsync()
            .ContinueOnSuccess(stats => Statistics.Value = stats));
 }
Ejemplo n.º 6
0
 private Task RefreshStatistics()
 {
     return(asyncDatabaseCommands
            .GetStatisticsAsync()
            .ContinueOnSuccessInTheUIThread(s => Statistics.Value = s));
 }