public async Task Run(TransactionFilter transactionFilter, LedgerOffset beginOffset, LedgerOffset endOffset, bool verbose, string accessToken = null, TraceContext traceContext = null) { await using (var stream = _transactionsClient.GetTransactions(transactionFilter, beginOffset, endOffset, verbose, accessToken, traceContext)) { while (await stream.MoveNextAsync()) { foreach (var tx in stream.Current.Transactions) { _state = _update(_state, tx); var commands = _handler(_state); await _commandClient.SubmitAndWaitAsync(commands); } } } }
public async Task Run( TransactionFilter transactionFilter, LedgerOffset beginOffset, LedgerOffset endOffset = null, bool verbose = true, string accessToken = null, TraceContext traceContext = null) { using (var stream = _transactionClient.GetTransactions(transactionFilter, beginOffset, endOffset, verbose, accessToken, traceContext)) { while (stream.MoveNext().Result) { foreach (var tx in stream.Current.Transactions) { var commands = _handler(tx); await _commandClient.SubmitAndWaitAsync(commands); } } } }