<s> import threading <EOL> import time <EOL> from ec2_observer . event_loop import XOSObserver <EOL> from ec2_observer . event_manager import EventListener <EOL> from xos . logger import Logger , logging <EOL> logger = Logger ( level = logging . INFO ) <EOL> class Backend : <EOL> def run ( self ) : <EOL> try : <EOL> observer = XOSObserver ( ) <EOL> observer_thread = threading . Thread ( target = observer . run ) <EOL> observer_thread . start ( ) <EOL> event_manager = EventListener ( wake_up = observer . wake_up ) <EOL> event_manager_thread = threading . Thread ( target = event_manager . run ) <EOL> event_manager_thread . start ( ) <EOL> except : <EOL> logger . log_exc ( "<STR_LIT>" ) </s>
