public async Task Execute() { await _log.WriteInfoAsync(_componentName, "", "", "Cycle started"); var filterBuilder = Builders <TransactionMongoEntity> .Filter; var txesFilter = filterBuilder.Eq(x => x.WasProcessed, false) | filterBuilder.Exists(x => x.WasProcessed, false); var numTxes = await _blockchainExplorer.CountAsync(txesFilter); if (numTxes < 100) { //await _emailNotifier.Notify("a", "bbb"); } if (await _transitQueue.Count() > 100) { //await _emailNotifier.Notify("", ""); } if (await _cashoutQueue.Count() > 5) { //await _emailNotifier.Notify("", ""); } }
public async Task Start() { int?cnt = 0; int i = 0; while ((cnt = await _fromQueue.Count()) > 0) { var msg = await _fromQueue.GetRawMessageAsync(); await _toQueue.PutRawMessageAsync(msg.AsString); await _fromQueue.FinishRawMessageAsync(msg); Console.WriteLine($"Processed {++i} from {cnt}"); } }
public async Task RemoveFromPendingOperationQueue(string opId) { var count = await _queue.Count(); for (int i = 0; i < count; i++) { var message = await _queue.GetRawMessageAsync(); OperationHashMatchMessage newMessage = JsonConvert.DeserializeObject <OperationHashMatchMessage>(message.AsString); await _queue.FinishRawMessageAsync(message); if (newMessage.OperationId?.ToLower() != opId?.ToLower()) { await _queue.PutRawMessageAsync(message.AsString); } } }
public int Count() { return(_queue.Count() ?? 0); }
public async Task <int> Count() { return(await _queue.Count() ?? 0); }
public async Task AzureQueue_CheckInsert() { await _testQueue.PutRawMessageAsync("test"); Assert.AreEqual(1, await _testQueue.Count() ?? 0); }
public Task <int?> Count() => WrapAsync(() => _impl.Count(), Name);