You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use django-socketio but faced an issue. When an event is emitted from the client-side, it is immediately received on the server side. However, when the server-side emits the event, it is only received when the sending function from the server-side code returns. I tried by sending multiple emits and then returning. Here is the sample code
Here is my events.py
@Namespace('/test')
class TestNs(BaseNamespace):
def on_test(self,msg):
for i in range(5):
self.emit('test','1')
time.sleep(1)
time.sleep(10)
self.emit('test','atlast')
And here is what the client looks like
var socket = io.connect('/test');
socket.emit('test','Send to server');
socket.on('test', function(data){console.log("Got back " + data(})
Client-side shows data when the sender in server-side returns. Am I missing something or is this a buffering issue?
The text was updated successfully, but these errors were encountered:
It works with gevent.sleep(). I think it has something to do with gevent threads. They ought to know that the application wants to sleep. Just guessing though
I tried to use django-socketio but faced an issue. When an event is emitted from the client-side, it is immediately received on the server side. However, when the server-side emits the event, it is only received when the sending function from the server-side code returns. I tried by sending multiple emits and then returning. Here is the sample code
Here is my events.py
And here is what the client looks like
Client-side shows data when the sender in server-side returns. Am I missing something or is this a buffering issue?
The text was updated successfully, but these errors were encountered: