public async Task <long> Request_Emitter()
        {
            var sum = 0L;

            foreach (var query in _queries)
            {
                var boo = await _emitter.Ask(query);

                sum += boo.Int;
            }

            return(sum);
        }
        public async Task <long> FullPipeline_Emitter()
        {
            var sum = 0L;

            foreach (var query in _queries)
            {
                var boo = await _emitterWithFullPipeline.Ask(query);

                sum += boo.Int;
            }

            return(sum);
        }
Beispiel #3
0
        public async Task AskMultiThreading(Boo[] boos)
        {
            var queries = boos.Select(b => new Query(b.Id)).ToArray();

            var results = await RunTasks(queries, query => _emitter.Ask(query));

            foreach (var query in queries)
            {
                query.PreProcessed.Should().BeTrue();
                query.PostProcessed.Should().BeTrue();

                _repository.Verify(repository => repository
                                   .GetElement(It.Is <int>(id => id == query.Id)));

                results.Should().Contain(b => b.Id == query.Id);
            }
        }