I need to run a WAMP client component within a webserver (FastAPI).
All examples use the ‘run’ method to launch the component. However the run method will monopolize the event-loop as it is going to call ‘loop.run_forever’.
So currently I’m calling the ‘_run’ underneath directly from within a task but is that the proper way of doing it?
You’re using the Component API, right? In that case, there is the start() method, which is intended for your use-case. The run() method starts logging, start()s all the components, handles cleanup, etc … so if you’re already handling all that, the start() method should be the right approach.