public bool Contains(IIndexTask instance) { lock (padlock) { return cq.Contains(instance); } }
/// <summary> /// Perform indexing for a given checkpoint type. /// </summary> /// <param name="type">The checkpoint type to index.</param> /// <param name="fromHeight">The height to index from.</param> /// <param name="toHeight">The height to index to.</param> private void PerformIndexing(IndexerCheckpoints type, int fromHeight, int toHeight) { if (!this.nodeLifetime.ApplicationStopping.IsCancellationRequested) { // Index a batch of blocks/transactions/balances/wallets var fetcher = this.GetBlockFetcher(type); if (toHeight > fetcher._LastProcessed.Height) { fetcher.FromHeight = Math.Max(fetcher._LastProcessed.Height + 1, fromHeight); fetcher.ToHeight = toHeight; IIndexTask task = null; switch (type) { case IndexerCheckpoints.Blocks: task = new IndexBlocksTask(this.IndexerConfig, this.loggerFactory); break; case IndexerCheckpoints.Transactions: task = new IndexTransactionsTask(this.IndexerConfig, this.loggerFactory); break; case IndexerCheckpoints.Balances: task = new IndexBalanceTask(this.IndexerConfig, null, this.loggerFactory); break; case IndexerCheckpoints.Wallets: task = new IndexBalanceTask(this.IndexerConfig, this.IndexerConfig.CreateIndexerClient().GetAllWalletRules(), this.loggerFactory); break; } task.SaveProgression = !this.indexerSettings.IgnoreCheckpoints; task.Index(fetcher, this.AzureIndexer.TaskScheduler, this.FullNode.Network); } } }
public bool Contains(IIndexTask instance) { lock (padlock) { return(cq.Contains(instance)); } }
void AddTaskIndex(Checkpoint checkpoint, IIndexTask indexTask) { _IndexTasks.Add(checkpoint.CheckpointName, Tuple.Create(checkpoint, indexTask)); }
public bool TryDequeue(out IIndexTask task) { return cq.TryDequeue(out task); }
public void Queue(IIndexTask task) { cq.Enqueue(task); }
public bool TryDequeue(out IIndexTask task) { return(cq.TryDequeue(out task)); }