added some stubs for backend threading
This commit is contained in:
parent
ddd7c5be09
commit
3a4c4c412e
3 changed files with 21 additions and 6 deletions
|
|
@ -28,12 +28,13 @@ import logging
|
|||
import logging.handlers
|
||||
import os
|
||||
import os.path as path
|
||||
import threading
|
||||
|
||||
from linspector.core.interface import LinspectorInterface
|
||||
from linspector.config.parser import FullConfigParser
|
||||
from linspector.core.job import Job
|
||||
from linspector.core.scheduler import Scheduler
|
||||
from linspector.backends.https import HttpsBackend
|
||||
from linspector.backends.jsonrpc import JsonrpcBackend
|
||||
from linspector.frontends.lish import LishFrontend
|
||||
|
||||
|
||||
|
|
@ -123,6 +124,9 @@ def main():
|
|||
job.set_logger(log)
|
||||
jobs.append(job)
|
||||
|
||||
#x = JsonrpcBackend()
|
||||
#x.daemon = True
|
||||
#x.start()
|
||||
#TODO: Load Backend Threads here before initializing the frontend.
|
||||
'''
|
||||
for backend in backends.enabled
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Backends can be a http service or xml-rpc service; let's say background threads providing an interface somewhere. They
|
||||
should run as background threads.
|
||||
Backends can be a http service or xml-rpc service; let's say
|
||||
background threads providing an interface somewhere. They should
|
||||
run as background threads.
|
||||
|
||||
Backends are absolutely no requirement for running Linspector.
|
||||
|
||||
|
|
@ -22,7 +23,9 @@ You should have received a copy of the GNU Affero General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import threading
|
||||
|
||||
class Backend():
|
||||
|
||||
class Backend(threading.Thread):
|
||||
def __init__(self, **kwargs):
|
||||
return
|
||||
threading.Thread.__init__(self)
|
||||
|
|
@ -19,9 +19,17 @@ You should have received a copy of the GNU Affero General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import time
|
||||
|
||||
from linspector.backends.backend import Backend
|
||||
|
||||
|
||||
class JsonrpcBackend(Backend):
|
||||
def __init__(self, **kwargs):
|
||||
super(Backend, self).__init__(**kwargs)
|
||||
return
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
print "foo"
|
||||
time.sleep(5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue