コード例 #1
0
 private void WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
 {
     using (var helper = new WaitForDescriptionChangedHelper(this, selector, description, descriptionChangedTask, timeout, cancellationToken))
     {
         var index = Task.WaitAny(helper.Tasks);
         helper.HandleCompletedTask(helper.Tasks[index]);
     }
 }
コード例 #2
0
        private async Task WaitForDescriptionChangedAsync(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
        {
            using (var helper = new WaitForDescriptionChangedHelper(this, selector, description, descriptionChangedTask, timeout, cancellationToken))
            {
                var completedTask = await Task.WhenAny(helper.Tasks).ConfigureAwait(false);

                helper.HandleCompletedTask(completedTask);
            }
        }
コード例 #3
0
 private async Task WaitForDescriptionChangedAsync(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
 {
     using (var helper = new WaitForDescriptionChangedHelper(this, selector, description, descriptionChangedTask, timeout, cancellationToken))
     {
         var completedTask  = await Task.WhenAny(helper.Tasks).ConfigureAwait(false);
         helper.HandleCompletedTask(completedTask);
     }
 }
コード例 #4
0
 private void WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
 {
     using (var helper = new WaitForDescriptionChangedHelper(this, selector, description, descriptionChangedTask, timeout, cancellationToken))
     {
         var index = Task.WaitAny(helper.Tasks);
         helper.HandleCompletedTask(helper.Tasks[index]);
     }
 }