Replies: 1 comment
-
Loop::defer is your friend |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone!
I am struggling to understand how to properly use uWebSockets. I think documentation is a bit lacking. I am trying to offload some of the work to another thread (let's suppose I am transcoding a video in another thread) and I really don't want to block the main thread that is running a webserver. The closest example I found was CRC, however it runs in a blocking fashion because this operation is fast by it's nature.
Below is the code I written to demonstrate what I want to do.
I am not sure how to properly implement it. If I just make std::thread and wait for it, then main thread would still be blocked. I cannot make uWS calls from another thread, as this is not supported (if I understand correctly).
Also, since this transcoding operation can take a few seconds, I think I should send keepalives. Is there a built-in way to do that?
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions