I think it would depend on whether you have defined the event handler itself to 
be sync or async. [1]

[1] https://opensips.org/html/docs/modules/2.4.x/event_route.html#overview

Ben Newlin 

On 3/20/19, 10:56 AM, "Users on behalf of John Quick" 
<[email protected] on behalf of [email protected]> 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()
    function call?
    
    Can you even use async() or launch() from within an event handler?
    
    Using v2.4.4
    
    John Quick
    Smartvox Limited
    
    
    
    _______________________________________________
    Users mailing list
    [email protected]
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users
    
    

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to