Files
fusionpbx/resources
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-06-30 19:31:24 -06:00
2016-05-05 20:10:19 -06:00
2016-04-25 20:30:23 -05:00
2016-07-08 13:10:43 -06:00
2016-03-11 13:57:01 +00:00
2016-07-06 13:10:12 -06:00
2016-05-10 17:25:20 -06:00
2013-07-06 05:23:01 +00:00
2016-04-25 20:30:23 -05:00
2016-03-11 13:57:01 +00:00
2016-03-11 13:57:01 +00:00
2016-04-29 11:21:26 -06:00
2016-05-05 14:18:59 -06:00
2016-03-11 13:57:01 +00:00