Mqlhaha / downloader-ui

85 stars 8 forks source link

strange performance in sending downloading logs #14

Open Mqlhaha opened 3 years ago

Mqlhaha commented 3 years ago

In commit a11f276f6069468f324a99caab22637eaa01dee0 , I added websocket to enable the communication of client and server.

If I coded properly, after the connection is created, the server will begin to send logs using the following code

for line in self.pipe.stdout:
      print(line)
      emit("trans_task_log",line)

However, in server log the print worked as expected while the client can't receive the emitted log until the downloading process is done. But I think the client should get the information as soon as the server output info. So what may cause this problem?