Beispiel #1
0
 def remove(self, job):
     jobId = job._getJobId()
     # look up the job's priority
     pri = self._jobId2pri.pop(jobId)
     # TODO: this removal is a linear search
     self._pri2jobIds[pri].remove(jobId)
     # remove the job from the main table
     del self._pri2jobId2job[pri][jobId]
     # clean up the job's generator, if any
     job._cleanupGenerator()
     # remove the job's timeslice count
     self._jobId2timeslices.pop(jobId)
     # remove the overflow time
     self._jobId2overflowTime.pop(jobId)
     if len(self._pri2jobId2job[pri]) == 0:
         del self._pri2jobId2job[pri]
         if pri == self._highestPriority:
             if len(self._jobId2pri) > 0:
                 # calculate a new highest priority
                 # TODO: this is not very fast
                 priorities = self._getSortedPriorities()
                 self._highestPriority = priorities[-1]
             else:
                 taskMgr.remove(JobManager.TaskName)
                 self._highestPriority = 0
     self.notify.debug('removed job: %s' % job.getJobName())
Beispiel #2
0
 def shutdown(self):
     # Should be safe to import the global taskMgr by now.
     from panda3d.direct.task.TaskManagerGlobal import taskMgr
     taskMgr.remove('eventManager')
Beispiel #3
0
 def stopCheckingIncomingHTTP(self):
     taskMgr.remove('pollHTTPTask')
Beispiel #4
0
 def startCheckingIncomingHTTP(self, interval=0.3):
     taskMgr.remove('pollHTTPTask')
     taskMgr.doMethodLater(interval, self.pollHTTPTask, 'pollHTTPTask')
Beispiel #5
0
 def shutdown(self):
     # Should be safe to import the global taskMgr by now.
     from panda3d.direct.task.TaskManagerGlobal import taskMgr
     taskMgr.remove('eventManager')
Beispiel #6
0
 def stopCheckingIncomingHTTP(self):
     taskMgr.remove('pollHTTPTask')
Beispiel #7
0
 def startCheckingIncomingHTTP(self, interval=0.3):
     taskMgr.remove('pollHTTPTask')
     taskMgr.doMethodLater(interval,self.pollHTTPTask,'pollHTTPTask')
Beispiel #8
0
 def destroy(self):
     taskMgr.remove(JobManager.TaskName)
     del self._pri2jobId2job