[OpenSIPS-Users] wait_for_event(event,filter,timeout)
Liviu Chircu
liviu at opensips.org
Wed Aug 26 12:37:38 EST 2020
On 26.08.2020 15:24, Vitaliy Aleksandrov wrote:
> Your suggestion with async(sleep(), resume) is really cool.
Hey, Vitaliy!
I know, right? All programming textbooks say: "sleep() is bad", "Avoid
synchronizing with sleep()", "sleep() is hackish", etc. But, for this
use case, async(sleep()) helps you achieve this zero-cost polling loop,
which almost feels like magic! To me, it looks like the ideal
solution. Also, for more precision, you can use async(usleep()).
--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com
OpenSIPS Summit 2020 Distributed
www.opensips.org/events/Summit-2020Distributed
More information about the Users
mailing list