Replies: 3 comments 3 replies
-
The sleep_for function blocks current thread, that's not a good operation. please use some async timer instead. such as the loop->runAfter() method or the sleepCoro coroutine. |
Beta Was this translation helpful? Give feedback.
-
@an-tao Thank you for the response. We are using C++17 so I looked into the loop->runAfter() only thing is let's say we do app().getLoop()->runAfter(5, { /* some ops */}); |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, Currently I have a function "A" which waits using this_thread:sleep_for(..) until some condition is met. And I am calling the function "A" inside the http post request before sending the response. Is this correct way or there is some other way to wait for this function?
I am also using C++17
Beta Was this translation helpful? Give feedback.
All reactions