Couchbase.Management.BucketManager.WatchN1qlIndexes C# (CSharp) Method

WatchN1qlIndexes() public method

Watches all given indexes, polling the query service until they are "online" or the has expired.
public WatchN1qlIndexes ( List indexNames, System.TimeSpan watchTimeout ) : IResult>
indexNames List The list of indexes to watch for.
watchTimeout System.TimeSpan The timeout for the watch.
return IResult>
        public virtual IResult<List<IndexInfo>> WatchN1qlIndexes(List<string> indexNames, TimeSpan watchTimeout)
        {
            IndexResult result;
            var stopwatch = Stopwatch.StartNew();

            do
            {
                result = ListN1qlIndexes();
                if (!ShouldRetryWatch(result, indexNames))
                {
                    break;
                }

                Thread.Sleep(WatchIndexSleepDuration);
            } while (stopwatch.Elapsed < watchTimeout);

            return result;
        }