public WatchN1qlIndexesAsync ( List |
||
indexNames | List |
The list of indexes to watch for. |
watchTimeout | System.TimeSpan | The timeout for the watch. |
return | Task |
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;
}