some more threading stuff for backends.

This commit is contained in:
Johannes Findeisen 2013-10-20 04:09:46 +02:00
commit a0577c66ff
3 changed files with 11 additions and 8 deletions

View file

@ -124,17 +124,19 @@ def main():
job.set_logger(log)
jobs.append(job)
#x = JsonrpcBackend()
interface = LinspectorInterface(jobs, scheduler, linConf)
#x = JsonrpcBackend(interface)
#x.daemon = True
#x.start()
#TODO: Load Backend Threads here before initializing the frontend.
#TODO: load all backends in a loop
'''
for backend in backends.enabled
backend.start
take care of signals etc. to sthutdown the threads when stopping linspector.
'''
interface = LinspectorInterface(jobs, scheduler, linConf)
LishFrontend(interface)
log.debug("shutting down scheduler")

View file

@ -27,5 +27,6 @@ import threading
class Backend(threading.Thread):
def __init__(self, **kwargs):
threading.Thread.__init__(self)
def __init__(self, interface, **kwargs):
threading.Thread.__init__(self)
self.interface = interface

View file

@ -25,11 +25,11 @@ from linspector.backends.backend import Backend
class JsonrpcBackend(Backend):
def __init__(self, **kwargs):
def __init__(self, interface, **kwargs):
super(Backend, self).__init__(**kwargs)
return
self.interface = interface
def run(self):
while True:
print "foo"
print "hello from JsonrpcBackend thread..."
time.sleep(5)