(self)
| 30 | print(f"Listening on {self.host}:{self.port}...") |
| 31 | |
| 32 | async def start_server(self): |
| 33 | self.initialize_server() |
| 34 | # Can play with ping_interval and ping_timeout |
| 35 | # See: https://websockets.readthedocs.io/en/stable/topics/timeouts.html |
| 36 | # and https://github.com/letta-ai/letta/issues/471 |
| 37 | async with websockets.serve(self.handle_client, self.host, self.port): |
| 38 | await asyncio.Future() # Run forever |
| 39 | |
| 40 | def run(self): |
| 41 | return self.start_server() # Return the coroutine |