public virtual async Task<IResult<List<IndexInfo>>> WatchN1qlIndexesAsync(List<string> indexNames, TimeSpan watchTimeout)
{
IndexResult result;
var cancellationSource = new CancellationTokenSource(watchTimeout);
do
{
result = await ListN1qlIndexesAsync();
if (!ShouldRetryWatch(result, indexNames))
{
break;
}
try
{
await Task.Delay(WatchIndexSleepDuration, cancellationSource.Token);
}
catch (TaskCanceledException)
{
break;
}
} while (!cancellationSource.IsCancellationRequested);
return result;
}