Esempio n. 1
0
    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()
Esempio n. 2
0
    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()
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)
Esempio n. 5
0
    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
Esempio n. 6
0
 def add_jobs(self, jobs) :
     TaskScheduler.add_jobs(self, jobs)
     # Initialize the T_B for each job
     self.T_B.extend([timedelta()] * len(jobs))
Esempio n. 7
0
    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
Esempio n. 8
0
 def add_jobs(self, jobs):
     TaskScheduler.add_jobs(self, jobs)
     # Initialize the T_B for each job
     self.T_B.extend([timedelta()] * len(jobs))