public void Cancel(Rid rid) { if (_jobs.Remove(rid, out IPriorityQueueHandle <Job> h)) { var job = _jobQueue.Delete(h); _userJobs.Remove(job._ip); Console.WriteLine($"Cancelled {job}"); } }
public Rid Submit(Ip ip, int time) { var jobCount = _userJobs.ContainsCount(ip); var rid = new Rid(); var job = new Job(rid, ip, time + 60 * jobCount); IPriorityQueueHandle <Job> h = default; _jobQueue.Add(ref h, job); _userJobs.Add(ip); _jobs.Add(rid, h); Console.WriteLine($"Submitted {job}"); return(rid); }
public override string ToString() { return(Rid.ToString()); }
public Job(Rid rid, Ip ip, int time) { _rid = rid; _ip = ip; _time = time; }
public Job(Rid rid, Ip ip, int time) { Rid = rid; Ip = ip; Time = time; }