Tony Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 1 | import threading |
Tony Mack | b4cf100 | 2014-04-29 12:26:12 -0400 | [diff] [blame] | 2 | import time |
Sapan Bhatia | 757e0b6 | 2013-09-02 16:55:00 -0400 | [diff] [blame] | 3 | from observer.event_loop import PlanetStackObserver |
| 4 | from observer.event_manager import EventListener |
Tony Mack | b4cf100 | 2014-04-29 12:26:12 -0400 | [diff] [blame] | 5 | from util.logger import Logger, logging |
| 6 | |
| 7 | logger = Logger(level=logging.INFO) |
Tony Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 8 | |
| 9 | class Backend: |
| 10 | |
| 11 | def run(self): |
Tony Mack | b4cf100 | 2014-04-29 12:26:12 -0400 | [diff] [blame] | 12 | # 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 Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 21 | |