Tony Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 1 | import threading |
Sapan Bhatia | 757e0b6 | 2013-09-02 16:55:00 -0400 | [diff] [blame] | 2 | from observer.event_loop import PlanetStackObserver |
| 3 | from observer.event_manager import EventListener |
Tony Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 4 | |
| 5 | class Backend: |
| 6 | |
| 7 | def run(self): |
| 8 | # start the openstack observer |
Sapan Bhatia | f61e17a | 2013-08-26 15:38:39 -0400 | [diff] [blame] | 9 | observer = PlanetStackObserver() |
Tony Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 10 | observer_thread = threading.Thread(target=observer.run) |
| 11 | observer_thread.start() |
| 12 | |
| 13 | # start event listene |
Sapan Bhatia | 66f4e61 | 2013-07-02 12:12:38 -0400 | [diff] [blame] | 14 | event_manager = EventListener(wake_up=observer.wake_up) |
| 15 | event_manager_thread = threading.Thread(target=event_manager.run) |
| 16 | event_manager_thread.start() |
Tony Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 17 | |