blob: 1a2545d2dc9153fc89c043e486dfa5a1378b973e [file] [log] [blame]
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04001import threading
2import time
Scott Baker03552842015-02-18 16:13:48 -08003from ec2_observer.event_loop import XOSObserver
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04004from ec2_observer.event_manager import EventListener
5from util.logger import Logger, logging
6
7logger = Logger(level=logging.INFO)
8
9class Backend:
10
11 def run(self):
Sapan Bhatiaed83cf62014-07-22 00:35:56 -040012 # start the openstack observer
Scott Baker03552842015-02-18 16:13:48 -080013 observer = XOSObserver()
Sapan Bhatiaed83cf62014-07-22 00:35:56 -040014 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()
21 logger.log_exc("Exception in child thread")
Sapan Bhatia26d40bc2014-05-12 15:28:02 -040022