blob: 8e4cab324aed81019ade1a91030d91236d7d8d3e [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 # start the openstack observer
13 observer = PlanetStackObserver()
14 observer_thread = threading.Thread(target=observer.run)
15 observer_thread.start()
16
17 # start event listene
18 event_manager = EventListener(wake_up=observer.wake_up)
19 event_manager_thread = threading.Thread(target=event_manager.run)
20 event_manager_thread.start()
Tony Mack79a49c82013-06-15 23:51:57 -040021