Beispiel #1
0
        public bool AddJob(IServerComponent component, IDownloadBatch batch, int maxCapacity)
        {
            var quenue = GetProcessingQueue(component);

            if (quenue.Count > maxCapacity)
            {
                return(false);
            }
            _log.Log(LogLevel.Information, this, component, "add downloadJob");
            quenue.Enqueue(batch);
            return(true);
        }
Beispiel #2
0
 public bool GetCompleted(IServerComponent component, out IDownloadBatch batch)
 {
     return(GetCompleteQueue(component).TryDequeue(out batch));
 }