How to start multiple ApplicationSession components?

Is there a way to start multiple wamp components that inherit ApplicationSession ? All examples that I have seen only start a single component, for example

I do know that can be done using Component API but wanted to be sure if it was possible with ApplicationSession or not.

1 Like

Yes. You can use ApplicationSession with Component so you can then run multiple components which use subclassing. Simply assign Component.session_factory or pass the session_factory= kwarg to Component with your ApplicationSession subclass.

1 Like

That’s a new thing I learned and will definitely be helpful. Though for my original question I was not using Component and found out that if I delay starting of the reactor, I can start multiple ApplicationSession subclass components like I did here

Okay, that should work as well.

“In general” new code would be best to use Component – especially so we can discover any remaining gaps.

1 Like