Correct way to asynchronously tryEnd() for streaming data #1303
Unanswered
cakepirate
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Ugh, that code doesn't make any sense whatsoever. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I'm trying to rewrite the asyncfilestreamer example, with reference to the example in https://github.com/uNetworking/uWebSockets.js/blob/master/examples/VideoStreamer.js.
However, when I try to loop->defer each tryEnd() call for each chunk of data, and then loop->run() to block and complete execution before continuing onto the next chunk, the function does not exit the loop->defer call - am I misunderstanding the use of loop->defer?
I also tried to loop->defer the entire while loop, but this results in non-asynchronous behaviour. What's the correct way to asynchronously perform this without resorting to the seemingly recursive pattern in the original asyncFile example?
Beta Was this translation helpful? Give feedback.
All reactions