Exemplo n.º 1
0
 public SegmentTaskWorker(int numberOfParallelTasks,
                          ISegmentTaskQueue segmentTaskQueue)
 {
     _numberOfParallelTasks = numberOfParallelTasks;
     _segmentTaskQueue      = segmentTaskQueue;
     _counter = 0;
 }
Exemplo n.º 2
0
 public SelfRefreshingSegmentFetcher(ISegmentChangeFetcher segmentChangeFetcher,
                                     IStatusManager statusManager,
                                     int interval,
                                     ISegmentCache segmentsCache,
                                     int numberOfParallelSegments,
                                     ISegmentTaskQueue segmentTaskQueue,
                                     ITasksManager tasksManager,
                                     IWrapperAdapter wrapperAdapter) : base(segmentsCache)
 {
     _segmentChangeFetcher = segmentChangeFetcher;
     _segments             = new ConcurrentDictionary <string, SelfRefreshingSegment>();
     _worker           = new SegmentTaskWorker(numberOfParallelSegments, segmentTaskQueue);
     _interval         = interval;
     _statusManager    = statusManager;
     _wrappedAdapter   = wrapperAdapter;
     _segmentTaskQueue = segmentTaskQueue;
     _tasksManager     = tasksManager;
 }
        public SelfRefreshingSegmentFetcher(ISegmentChangeFetcher segmentChangeFetcher,
                                            IReadinessGatesCache gates,
                                            int interval,
                                            ISegmentCache segmentsCache,
                                            int numberOfParallelSegments,
                                            ISegmentTaskQueue segmentTaskQueue) : base(segmentsCache)
        {
            _cancelTokenSource = new CancellationTokenSource();

            _segmentChangeFetcher = segmentChangeFetcher;
            _segments             = new ConcurrentDictionary <string, SelfRefreshingSegment>();
            _worker           = new SegmentTaskWorker(numberOfParallelSegments, segmentTaskQueue);
            _interval         = interval;
            _gates            = gates;
            _wrappedAdapter   = new WrapperAdapter();
            _segmentTaskQueue = segmentTaskQueue;

            StartWorker();
        }