fixed eventloop endless restart when wmii goes away
[wmiirc-lua.git] / luaeventloop / test.lua
blobb6b666919ba8ee52148fdfaf564cdb570c67f2d4
1 #!/usr/bin/env lua
3 require "eventloop"
5 el = eventloop.new()
7 io.stderr:write("---- adding dsat --load\n")
8 el:add_exec ("dstat --load --nocolor --noheaders --noupdate",
9 function (line)
10 local line = line:gsub("\n$","")
11 print (" ** load: " .. line)
12 end)
14 io.stderr:write("---- adding dstat --int\n")
15 el:add_exec ("dstat --int --nocolor --noheaders --noupdate",
16 function (line)
17 local line = line:gsub("\n$","")
18 print (" ** int: " .. line)
19 end)
21 io.stderr:write("---- running loop\n")
22 el:run_loop(10)
24 io.stderr:write("---- finished\n")