private async Task <TransactionItem[]> GetBundleTransactionItems(string bundleHash)
        {
            await TaskIota.Yield().ConfigureAwait(false);

            var api          = CreateIotaClient();
            var transactions = await api.GetBundleTransactionItems(bundleHash);

            return(transactions);
        }
        private async Task <TransactionItem[]> GetTransactionItems(params string[] transactionHashes)
        {
            await TaskIota.Yield().ConfigureAwait(false);

            var api          = CreateIotaClient();
            var transactions = await api.GetTransactionItems(transactionHashes);

            return(transactions);
        }
示例#3
0
        public async Task ParallelAsyncTest()
        {
            var list  = new ConcurrentBag <bool>();
            var range = Enumerable.Range(0, 1000);
            await range.ParallelAsync(async u =>
            {
                await TaskIota.Yield().ConfigureAwait(false);
                //await Task.Yield();
                Thread.Sleep(100);
                list.Add(true);
            });

            Assert.AreEqual(range.Count(), list.Count());
        }