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); }
public bool GetCompleted(IServerComponent component, out IDownloadBatch batch) { return(GetCompleteQueue(component).TryDequeue(out batch)); }