<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi, Christian!<br>
<br>
The async execution stops the processing, unless there is an
internal error. Considering your question, here are a few scenarios
and execution stacks:<br>
Scenario 1: The async query completes successfully:<br>
route(0) -> async(avp_db_query) -> route(resume_some_blah); #
xlog bla is not printed<br>
<br>
Secnario 2: The async succeeds, but nothing was found<br>
route(0) -> async(avp_db_query) -> route(resume_some_blah); #
xlog bla is not printed and the returned code is -2<br>
<br>
Scenario 3: Something goes wrong and avp_db_query does not manage to
launch async query<br>
route(0) -> async(avp_db_query) fails -> xlog("xlog bla"); #
xlog is printed and avp_db_query() is not even executed<br>
<br>
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.<br>
<br>
Best regards,<br>
Răzvan<br>
<br>
<div class="moz-cite-prefix">On 02/27/2016 01:15 PM, Christian Lahme
wrote:<br>
</div>
<blockquote
cite="mid:5F2EC3C0-162D-4C6F-B792-C2165B4FA732@secusmart.de"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div style="font-family: Calibri, sans-serif;">Hi everybody,</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div style="font-family: Calibri, sans-serif;">I understood, that</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div>
<div><font face="Courier">route {</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"></span>async(avp_db_query("select
some_bla from some_table where somevar = 'somekey';",
$avp(some_bla)), resume_some_blah);</font></div>
<div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"></span>xlog("xlog
bla");</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div><font face="Courier">}</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">route[resume_some_blah] {</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"></span>#
do something</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">}</font></div>
</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div style="font-family: Calibri, sans-serif;">wan’t call the xlog
in first route.</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div style="font-family: Calibri, sans-serif;">But what about </div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div>
<div><font face="Courier">route {</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"></span>route(some_blah);</font></div>
<div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"></span>xlog("xlog
bla");</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div><font face="Courier">}</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">route[some_blah] {</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"></span>async(avp_db_query("select
some_bla from some_table where somevar = 'somekey';",
$avp(some_bla)), resume_some_blah);</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div><font face="Courier">}</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">route[resume_some_blah] {</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"><span class="Apple-tab-span" style="white-space:pre"></span>#
do something</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">}</font></div>
</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div style="font-family: Calibri, sans-serif;">Will xlog be
called?</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div style="font-family: Calibri, sans-serif;">Best regards </div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div style="font-family: Calibri, sans-serif;">Chris</div>
<div style="font-family: Calibri, sans-serif;">
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Răzvan Crainea
OpenSIPS Core Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
</body>
</html>