Home | Trees | Indices | Help |
---|
|
1 import threading,time 2 from logger import main_log, exception_log 3 from operationscore.ThreadedSmootCoreObject import ThreadedSmootCoreObject 4 import pdb6 """Abstract class for inputs. Inheriting classes should call "respond" to raise 7 their event. Inheriting classes MUST define sensingLoop. Called at the 8 interval specified in RefreshInterval while the input is active. For example, if you are writing 9 webserver, this is where the loop should go. 10 Inheriting classes MAY define inputInit. This is called before the loop 11 begins."""4913 self.eventQueue = [] 14 if not 'RefreshInterval' in self.argDict: 15 self.argDict['RefreshInterval'] = 500 16 self.parentScope = self.argDict['parentScope'] 17 self.inputInit()1820 eventDict['InputId'] = self['Id'] 21 self.parentScope.lock.acquire() 22 self.parentScope.processResponse(self.argDict, eventDict) 23 self.parentScope.lock.release() 24 time.sleep(.001)25 3234 while 1: 35 try: 36 die = self.parentAlive() 37 except: 38 break 39 time.sleep(self.argDict['RefreshInterval']/float(1000)) 40 self.acquireLock() 41 self.sensingLoop() 42 self.releaseLock()43 46
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Feb 18 16:55:27 2011 | http://epydoc.sourceforge.net |