aboutsummaryrefslogtreecommitdiffstats
path: root/conf.d/project/lua.d/signal-composer-daemon-10-event.lua
diff options
context:
space:
mode:
Diffstat (limited to 'conf.d/project/lua.d/signal-composer-daemon-10-event.lua')
-rw-r--r--conf.d/project/lua.d/signal-composer-daemon-10-event.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/conf.d/project/lua.d/signal-composer-daemon-10-event.lua b/conf.d/project/lua.d/signal-composer-daemon-10-event.lua
index 474ebe0..7724dec 100644
--- a/conf.d/project/lua.d/signal-composer-daemon-10-event.lua
+++ b/conf.d/project/lua.d/signal-composer-daemon-10-event.lua
@@ -24,11 +24,11 @@ _MyContext={}
-- WARNING: call back are global and should start with '_'
function _Timer_Test_CB (timer, context)
- local evtinfo= AFB:timerget(timer)
+ local evtinfo= AFB:timerget(source, timer)
printf ("[-- _Timer_Test_C --] evtInfo=%s", Dump_Table(evtinfo))
--send an event an event with count as value
- AFB:evtpush (_MyContext["event"], {["label"]= evtinfo["label"], ["count"]=evtinfo["count"], ["info"]=context["info"]})
+ AFB:evtpush (source, _MyContext["event"], {["label"]= evtinfo["label"], ["count"]=evtinfo["count"], ["info"]=context["info"]})
-- note when timerCB return!=0 timer is kill
return 0
@@ -44,7 +44,7 @@ function _Simple_Timer_Test (request, client)
-- if event does not exit create it now.
if (_MyContext["event"] == nil) then
- _MyContext["event"]= AFB:evtmake(client["label"])
+ _MyContext["event"]= AFB:evtmake(source, client["label"])
end
-- if delay not defined default is 5s
@@ -59,16 +59,16 @@ function _Simple_Timer_Test (request, client)
["delay"]=client["delay"],
["count"]=client["count"],
}
- AFB:notice ("Test_Timer myTimer=%s", myTimer)
+ AFB:notice (source, "Test_Timer myTimer=%s", myTimer)
-- subscribe to event
- AFB:subscribe (request, _MyContext["event"])
+ AFB:subscribe (source, request, _MyContext["event"])
-- settimer take a table with delay+count as input (count==0 means infinite)
- AFB:timerset (myTimer, "_Timer_Test_CB", context)
+ AFB:timerset (source, myTimer, "_Timer_Test_CB", context)
-- nothing special to return send back
- AFB:success (request, myTimer)
+ AFB:success (source, request, myTimer)
return 0
end