[OpenSIPS-Users] async and event handlers
Liviu Chircu
liviu at opensips.org
Mon Apr 22 02:40:57 EDT 2019
Hi, John!
Some answers below:
> My question is this: Can I use async() or launch() as a wrapper for a
> cache_store() function call made from within an event handler?
Calling async() or launch() from an event handler SHOULD work (see
below). Unfortunately, the "cache_" family of functions do not have
async support.
> Is there any
> advantage to doing so or can I regard event handlers as a safe place to
> initiate blocking operations because, I assume, events must already have
> their own queue.
This is where it gets interesting -- in many cases, which include the
usrloc save() operation, the event handlers are ran inline with the SIP
processing, by the same process! So performing a blocking operation in
that context still has the unpleasant potential to bog down your SIP
processing responsiveness/latencies.
Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
More information about the Users
mailing list