client doesn't receives if *args is in the event function parameters #924
Unanswered
akshay7892
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I'm sorry, but this is very difficult for me to understand, so I cannot give you specific details. What I can tell you is that you cannot mix sync and async code in the same application. If your input WebSocket uses sync code, then you should use a sync SocketIO server, as a mixture will cause blocking on the async side. Also, please do not file issues on this project when you need help. The issues board is for bugs. Use the discussions board when you have questions. Thanks. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Miguel, first of all , a ton of thanks to you for creating such amazing product and making it awailable for the community, I really appreciate your efforts. I'm a newbie in python world so please bear with me. I'm trying to provide as much info as I can, to help you to help me solve this issue.
I'm getting live data from a broker's websocket, wrapped inside a python class which is stored in another file named "ws" and is imported into this file. The Broker has provided two functions socket and custom_message code for them is as follows.
socket
custom_message
As you can see the data from brokers data socket is getting set into
custom_message
function but I want to stream this data to a charting library so needed a websocket which could work with above python functions and thanks to you I had python socketio. So I created an ASGI websocket watching your videos.The
msg
in received bycustom_message
is a python list containing a dictionary. As both the functionssocket
andcustom_message
are synchronous and the ASGI requires asyn functions, I needed a bridge that could connect these sync function to event async function. So I madecustom_message
function recive the message and forward it to async function. I implemented it as followsWhich is working fine if we look at the server's logs in the terminal e.g.
Terminal Logs
The client receives the
sum_result
andreconnect
message fromsum
event. However, it isn't receiving the (second)reconnect
andm
message in theSubAdd
event which is evident from message logs in devtools.Logs of devtools

So what and where should I make the changes so that client whould receive all messages from all events.
Thank You!!
client.js
Beta Was this translation helpful? Give feedback.
All reactions