blob: 293a32566d5cd6a0cce46d8ab927709f6b7092ce [file] [log] [blame]
Tony Mack79a49c82013-06-15 23:51:57 -04001import threading
Tony Mackb4cf1002014-04-29 12:26:12 -04002import time
Sapan Bhatia757e0b62013-09-02 16:55:00 -04003from observer.event_loop import PlanetStackObserver
4from observer.event_manager import EventListener
Tony Mackb4cf1002014-04-29 12:26:12 -04005from util.logger import Logger, logging
6
7logger = Logger(level=logging.INFO)
Tony Mack79a49c82013-06-15 23:51:57 -04008
9class Backend:
10
11 def run(self):
Tony Mackb4cf1002014-04-29 12:26:12 -040012 try:
13 # start the openstack observer
14 observer = PlanetStackObserver()
15 observer_thread = threading.Thread(target=observer.run)
16 observer_thread.start()
17
18 # start event listene
19 event_manager = EventListener(wake_up=observer.wake_up)
20 event_manager_thread = threading.Thread(target=event_manager.run)
21 event_manager_thread.start()
22 except:
23 logger.log_exc("Exception in child thread")
Tony Mack79a49c82013-06-15 23:51:57 -040024