Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="TransferScheduler" /> class.
        /// </summary>
        /// <param name="options">BlobTransfer options.</param>
        public TransferScheduler(TransferConfigurations options)
        {
            // If no options specified create a default one.
            this.transferOptions = options ?? new TransferConfigurations();

            this.internalControllerQueue = new ConcurrentQueue <ITransferController>();
            this.controllerQueue         = new BlockingCollection <ITransferController>(
                this.internalControllerQueue);
            this.memoryManager = new MemoryManager(
                this.transferOptions.MaximumCacheSize,
                this.transferOptions.MemoryChunkSize);

            this.randomGenerator = new Random();

            this.ongoingTasks = 0;

            this.StartSchedule();
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="TransferScheduler" /> class.
        /// </summary>
        /// <param name="options">BlobTransfer options.</param>
        public TransferScheduler(TransferConfigurations options)
        {
            // If no options specified create a default one.
            this.transferOptions = options ?? new TransferConfigurations();

            this.internalControllerQueue = new ConcurrentQueue <ITransferController>();
            this.controllerQueue         = new BlockingCollection <ITransferController>(
                this.internalControllerQueue);
            this.memoryManager = new MemoryManager(
                this.transferOptions.MaximumCacheSize,
                this.transferOptions.BlockSize);

            this.randomGenerator = new Random();

            this.scheduleSemaphore = new SemaphoreSlim(
                this.transferOptions.ParallelOperations,
                this.transferOptions.ParallelOperations);

            this.StartSchedule();
        }
        /// <summary>
        /// Initializes a new instance of the 
        /// <see cref="TransferScheduler" /> class.
        /// </summary>
        /// <param name="options">BlobTransfer options.</param>
        public TransferScheduler(TransferConfigurations options)
        {
            // If no options specified create a default one.
            this.transferOptions = options ?? new TransferConfigurations();

            this.internalControllerQueue = new ConcurrentQueue<ITransferController>();
            this.controllerQueue = new BlockingCollection<ITransferController>(
                this.internalControllerQueue);
            this.memoryManager = new MemoryManager(
                this.transferOptions.MaximumCacheSize,
                this.transferOptions.BlockSize);

            this.randomGenerator = new Random();

            this.scheduleSemaphore = new SemaphoreSlim(
                this.transferOptions.ParallelOperations, 
                this.transferOptions.ParallelOperations);

            this.StartSchedule();
        }