コード例 #1
0
        /// <summary>
        /// Initialize to TPL blocks
        /// </summary>
        protected void InitBlocks()
        {
            _fanartActionBlock = new FanArtActionBlock();

            //Bounded capacity of 2 means there is at max 1 cleanup task running and 1 waiting
            _fanartCleanupBlock = new ActionBlock <bool>(_ => CleanupFanArt(),
                                                         new ExecutionDataflowBlockOptions {
                BoundedCapacity = 2
            });
        }