<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
On 3/29/12 3:15 PM, Javier Gallart wrote:
<blockquote
cite="mid:CACviLGZBDi0uFJK0ekBzCE5F9BZ+dyQg2S0wnjf4AFC7MOUQNQ@mail.gmail.com"
type="cite">Thanks Daniel<br>
<br>
<div class="gmail_quote">On Thu, Mar 29, 2012 at 2:49 PM,
Daniel-Constantin Mierla <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,
<div class="im"><br>
<br>
On 3/29/12 11:49 AM, Javier Gallart wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello all<br>
<br>
I'm starting to play with lua scripting in Kamailio. It's
really cool, some complex stuff in the script becomes
really easy this way. The script is becoming quite big,
therefore I'd like to use lua_run instead of lua_dofile.
My doubt is pretty basic: if i load a script in memory at
startup via the "load" parameter and the script is modifed
afterwards, is there any way to reload the module so the
script is reread?<br>
</blockquote>
</div>
the two contexts created by app_lua were designed one for
loading at startup and the other for reloading every time.
Reloading on demand at runtime is not possible. I thought of
checking the timestamp of the script, but can be a bit risky
if saving on intermediary state during updates. The scripts
are loaded in each process, sending a mi/rpc command will
require to do some inter-process signaling. Both doable, not
in my short term plans, though, if someone is contributing,
will be appreciated.<br>
</blockquote>
<div>Understood, we may give it a try in the next weeks. </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Some options for speed up with existing code:<br>
- you can compile the Lua scripts, so reloading it each time
will be faster (no more compile on-the-fly)<br>
</blockquote>
<div>I agree it's the most logical approach.</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
- not sure about this one: in your script loaded at startup
you may have some logic to load another script based on your
rules (e.g., file timestamp, periodically, ...)<br>
</blockquote>
<div>Not sure either, will try.</div>
<div><br>
</div>
<div>What about using luajit? <br>
</div>
</div>
</blockquote>
how to use it?<br>
<br>
Cheers,<br>
Daniel<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
<a class="moz-txt-link-freetext" href="http://www.asipto.com/index.php/kamailio-advanced-training/">http://www.asipto.com/index.php/kamailio-advanced-training/</a></pre>
</body>
</html>