Files
fusionpbx/resources/install/scripts
Alexey Melnichuk cae644c8a1 Add. EventConsumer class. (#1741)
Rewrite MWI and CallFlow subscribe handlers based on EventConsumer class.
Also on my test VirtualBox/Debian system Lua function `os.clock` produce
very strange result(delta ~0.015 for 1 second) so I switch to `os.time`.
Now to to stop this background Lua scripts it possible send CUSTOM event
with subclass `fusion::XXX::shutdown`. Where XXX is `mwi` or `flow`.

Usage of EventConsumer class
```Lua
-- create new object with timeout one minute
local events = EventConsumer.new(60000)

-- bind to some FS event
events:bind("SHUTDOW", function(self, name, event) ... end)

-- bind to another FS event with subclass
events:bind("CUSTOM::fusion::mwi::shutdown", function(self, name, event) ... end)

-- handle timeout event
events:on("TIMEOUT", function(self, name) ... end)

--run event loop
events:run()
```
2016-07-08 13:10:43 -06:00
..
2016-07-08 13:10:43 -06:00
2016-06-12 14:14:52 -06:00
2015-08-11 14:40:02 +04:00
2016-02-24 19:59:54 -05:00
2015-11-05 18:02:08 +03:00
2016-05-12 23:06:45 -06:00
2016-07-06 14:48:00 -06:00
2014-07-31 08:40:15 +00:00