def __init__(self, surveil_job, concurrent_max=1) : TaskScheduler.__init__(self, concurrent_max) self.T_B = [] self.surveil_job = surveil_job # The T_B value threshold for action self.actionTB = timedelta()
def __init__(self, surveil_job, concurrent_max=1): TaskScheduler.__init__(self, concurrent_max) self.T_B = [] self.surveil_job = surveil_job # The T_B value threshold for action self.actionTB = timedelta()
def increment_timer(self, timeElapsed) : # Increment the T_B of all jobs by the elapsed time # NOTE: can't do `tb += timeElapsed` because += operator on # a timedelta object isn't in-place. Go figure... for index in range(len(self.T_B)) : self.T_B[index] += timeElapsed TaskScheduler.increment_timer(self, timeElapsed)
def increment_timer(self, timeElapsed): # Increment the T_B of all jobs by the elapsed time # NOTE: can't do `tb += timeElapsed` because += operator on # a timedelta object isn't in-place. Go figure... for index in range(len(self.T_B)): self.T_B[index] += timeElapsed TaskScheduler.increment_timer(self, timeElapsed)
def rm_jobs(self, jobs) : findargs, args = TaskScheduler.rm_jobs(self, jobs) for anItem in args : del self.T_B[findargs[anItem]] return findargs, args
def add_jobs(self, jobs) : TaskScheduler.add_jobs(self, jobs) # Initialize the T_B for each job self.T_B.extend([timedelta()] * len(jobs))
def rm_jobs(self, jobs): findargs, args = TaskScheduler.rm_jobs(self, jobs) for anItem in args: del self.T_B[findargs[anItem]] return findargs, args
def add_jobs(self, jobs): TaskScheduler.add_jobs(self, jobs) # Initialize the T_B for each job self.T_B.extend([timedelta()] * len(jobs))