Untitled

mail@pastecode.io avatar
unknown
python
a year ago
514 B
1
Indexable
Never
    async def listen_to_events(self):
        while True:
            try:
                event_name, event_data = await self.emitter.wait_for_event()
                if event_name == "search_result":
                    await self.handle_search_result_event(event_data)
                elif event_name == "search_ended":
                    await self.handle_search_ended_event(event_data)
            except Exception as e:
                logging.error(f"An error occurred while listening to events: {str(e)}")