-
-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How use socketio decorator within another class #390
Comments
What part of this does not work? The only thing I noticed is that the on_login method is missing As a side note, you may want to look at class-based namespaces in the documentation, as they already provide a way to implement events as methods in a class. |
Thanks for your reply.
sio wants connect(), but here class wants connect(self) |
And i think i sort out this by putting all sio related events inner function(def) of class def. And it works still. I have a request for connection establishment. It got hang on ide as like httplib connection. |
This might be old and you have solved it. @staticmethod |
i know this is old but i wanted to have this kind of functionality and i have done this
|
Sorry for this noob questions, I'm a python beginner. Please help me.
|
@paulbuer My suggestion is that you first make your client work in the standard way. Once you have it working, many of your questions will be more clear to you. Also, let me mention one more time that this package has class-based namespaces for implementing the client in a class. Maybe that is enough for your needs and you don't need to invent a new wheel for this. |
@miguelgrinberg |
Thank you for this. @miguelgrinberg perhaps add this to the docs? I am now using this setup which works great. Otherwise perhaps we update the decorators to work within a class environment. |
Hi Miguel
I tried to use socketio.Client within a class where i can call socketio and its related event frequently.But dnt understand how figure out it.
It works fine on normal python file.
i m a part time coder,so plz dnt laugh on my coding.
Thanks in advance.
The text was updated successfully, but these errors were encountered: