[OpenSIPS-Users] Understanding async support in 2.x

Răzvan Crainea razvan at opensips.org
Mon Feb 29 10:35:05 CET 2016


Hi, Christian!

The async execution stops the processing, unless there is an internal 
error. Considering your question, here are a few scenarios and execution 
stacks:
Scenario 1: The async query completes successfully:
route(0) -> async(avp_db_query) -> route(resume_some_blah); # xlog bla 
is not printed

Secnario 2: The async succeeds, but nothing was found
route(0) -> async(avp_db_query) -> route(resume_some_blah); # xlog bla 
is not printed and the returned code is -2

Scenario 3: Something goes wrong and avp_db_query does not manage to 
launch async query
route(0) -> async(avp_db_query) fails -> xlog("xlog bla"); # xlog is 
printed and avp_db_query() is not even executed

So unless there is something really bad going on, and the async query 
does not get to be run, you will never see the "xlog bla". Hope that was 
clear.

Best regards,
Răzvan

On 02/27/2016 01:15 PM, Christian Lahme wrote:
> Hi everybody,
>
> I understood, that
>
> route {
>
> async(avp_db_query("select some_bla from some_table where somevar = 
> 'somekey';", $avp(some_bla)), resume_some_blah);
> xlog("xlog bla");
> }
>
> route[resume_some_blah] {
>
> # do something
>
> }
>
> wan’t call the xlog in first route.
>
> But what about
>
> route {
>
> route(some_blah);
> xlog("xlog bla");
> }
>
> route[some_blah] {
>
> async(avp_db_query("select some_bla from some_table where somevar = 
> 'somekey';", $avp(some_bla)), resume_some_blah);
> }
>
> route[resume_some_blah] {
>
> # do something
>
> }
>
> Will xlog be called?
>
>
> Best regards
>
> Chris
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-- 
Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160229/7cf1c1e0/attachment.htm>


More information about the Users mailing list