Recommended way for client code that connects to many servers. #832
-
Hi,
Is there a recommended 'class based' approach? Is there a way to use the decorators with instance methods? At the moment I use a combination of solution 3 and Class-Based Namespaces. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
@schnabel Is the question how you write a wrapper class that combines the Socket.IO client instance and the event handlers all in the same class? I'm not sure I would do that myself, so I have no recommendation to make. But It is possible in Python to do this. You could add the client instance and the connection/disconnection methods to your namespace subclass, for example. |
Beta Was this translation helpful? Give feedback.
@schnabel Is the question how you write a wrapper class that combines the Socket.IO client instance and the event handlers all in the same class? I'm not sure I would do that myself, so I have no recommendation to make. But It is possible in Python to do this. You could add the client instance and the connection/disconnection methods to your namespace subclass, for example.