Tony Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 1 | import threading |
Tony Mack | 79a49c8 | 2013-06-15 23:51:57 -0400 | [diff] [blame] | 2 | from openstack.observer import OpenStackObserver |
Sapan Bhatia | 66f4e61 | 2013-07-02 12:12:38 -0400 | [diff] [blame] | 3 | from openstack.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 |
| 9 | observer = OpenStackObserver() |
| 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 | |