public PlayerMatchProducer(RiotApi riotApi, RiotQuerySettings querySettings, List<Queue> queryQueues, MatchDownloadLimiter testSynchronizer)
        {
            api = riotApi;
            this.querySettings = querySettings;
            this.queryQueues = queryQueues;
            this.testSynchronizer = testSynchronizer;

            // Create blocks
            PlayerBufferBlock = new BufferBlock<PlayerEntry>();
            PlayerToMatchesBlock = new TransformManyBlock<PlayerEntry, MatchSummary>(
                async player => await ConsumePlayerAsync(player),
                new ExecutionDataflowBlockOptions() { MaxDegreeOfParallelism = 2 });

            // Link blocks
            PlayerBufferBlock.LinkTo(PlayerToMatchesBlock, new DataflowLinkOptions() { PropagateCompletion = true });
        }
Example #2
0
        public PlayerMatchProducer(RiotApi riotApi, RiotQuerySettings querySettings, List <Queue> queryQueues, MatchDownloadLimiter testSynchronizer)
        {
            api = riotApi;
            this.querySettings    = querySettings;
            this.queryQueues      = queryQueues;
            this.testSynchronizer = testSynchronizer;

            // Create blocks
            PlayerBufferBlock    = new BufferBlock <PlayerEntry>();
            PlayerToMatchesBlock = new TransformManyBlock <PlayerEntry, MatchSummary>(
                async player => await ConsumePlayerAsync(player),
                new ExecutionDataflowBlockOptions()
            {
                MaxDegreeOfParallelism = 2
            });

            // Link blocks
            PlayerBufferBlock.LinkTo(PlayerToMatchesBlock, new DataflowLinkOptions()
            {
                PropagateCompletion = true
            });
        }