blob: d8ae30602a48fef02046e013cd0bd60b89362bb5 [file] [log] [blame]
Tony Mack79a49c82013-06-15 23:51:57 -04001import threading
Sapan Bhatia757e0b62013-09-02 16:55:00 -04002from observer.event_loop import PlanetStackObserver
3from observer.event_manager import EventListener
Tony Mack79a49c82013-06-15 23:51:57 -04004
5class Backend:
6
7 def run(self):
8 # start the openstack observer
Sapan Bhatiaf61e17a2013-08-26 15:38:39 -04009 observer = PlanetStackObserver()
Tony Mack79a49c82013-06-15 23:51:57 -040010 observer_thread = threading.Thread(target=observer.run)
11 observer_thread.start()
12
13 # start event listene
Sapan Bhatia66f4e612013-07-02 12:12:38 -040014 event_manager = EventListener(wake_up=observer.wake_up)
15 event_manager_thread = threading.Thread(target=event_manager.run)
16 event_manager_thread.start()
Tony Mack79a49c82013-06-15 23:51:57 -040017