[Freeswitch-users] Reload mod_lua

grmt garmt.noname at gmail.com
Tue Jan 22 23:31:59 MSK 2013


Rather than waiting forever using - pop(1) -, you can set a timeout value:
pop(1, 500). This allows you to let the lua script do some bookkeeping:
check for a hash value, file existence, sql select etc. and the script can
decide to end itself, without having to wait for a (specific) event.

Additionally, this will allow lua to do some bookkeeping. If you use a lua
script that runs forever while listening for events,  the script may eat
your memory, as lua might never get a chance to do proper garbage
collection.

Make sure you do not subscribe to all events in your lua script, processing
events in lua takes time, just subscribe to the events you need.

 

 

 

On 22 January 2013 15:53, Seven Du <dujinfang at gmail.com> wrote:

mod_lua was reloadable  but when I found that long-running scripts cannot be
easily stopped the developers changed it to un-reloadable.

 

I'd find some way to start/stop long-running scripts and I'd seen some
implementations based on my example:

 

http://fisheye.freeswitch.org/browse/freeswitch-contrib.git/seven/lua/gatewa
y_report.lua?hb=true

 

 

There's also a blog page in Chinese explaining this:
http://www.freeswitch.org.cn/2010/03/15/zai-freeswitchzhong-zhi-xing-chang-q
i-yun-xing-de-qian-ru-shi-jiao-ben-luayu-yan-li-zi.html

 

 

Hope this helps.

 

 

On Tuesday, January 22, 2013 at 3:40 PM, Mimiko wrote:

On 21.01.2013 23:47, William King wrote:

Interesting. A mod_lua api that would list the currently running lua

scripts with an id that could be used to kill off individual scripts.

 

Lua scripts, started with FS on start-up must not be killed, but updated 

when changing code of script. A killing command for a lua script is ok 

for scripts that got in loop/.

 

-- 

Mimiko desu.

 

_________________________________________________________________________

Professional FreeSWITCH Consulting Services:

consulting at freeswitch.org

http://www.freeswitchsolutions.com

 





 

Official FreeSWITCH Sites

http://www.freeswitch.org

http://wiki.freeswitch.org

http://www.cluecon.com

 

FreeSWITCH-users mailing list

FreeSWITCH-users at lists.freeswitch.org

http://lists.freeswitch.org/mailman/listinfo/freeswitch-users

UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users

http://www.freeswitch.org

 


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130122/194296d3/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list