[OpenSIPS-Users] async and event handlers
Ben.Newlin at genesys.com
Wed Mar 20 11:35:55 EDT 2019
I think it would depend on whether you have defined the event handler itself to be sync or async. 
On 3/20/19, 10:56 AM, "Users on behalf of John Quick" <users-bounces at lists.opensips.org on behalf of john.quick at smartvox.co.uk> wrote:
I have a script which employs USRLOC to save registrations and also has an
event handler defined for E_UL_CONTACT_INSERT.
It is convenient, for the required logic/business rules, that I update a
user database from within the event handler.
If the DB update were happening directly from the main route, then I would
probably use async(avp_db_query())
However, if a potentially blocking operation - such as a DB write - is done
from within the event handler, am I correct in thinking that this is much
safer and therefore does not need to be wrapped in an async() or launch()
Can you even use async() or launch() from within an event handler?
Users mailing list
Users at lists.opensips.org
More information about the Users