projects
/
project
/
ubus.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
f59448db72c5e233ce70c908df0ccf21791f31c3
[project/ubus.git]
/
lua
/
subscriber.lua
1
#!/usr/bin/env lua
2
3
--[[
4
A demo of ubus subscriber binding. Should be run after publisher.lua
5
--]]
6
7
require "ubus"
8
require "uloop"
9
10
uloop.init()
11
12
local conn = ubus.connect()
13
if not conn then
14
error("Failed to connect to ubus")
15
end
16
17
local sub = {
18
notify = function( msg, name )
19
print("name:", name)
20
print(" count:", msg["count"])
21
end,
22
}
23
24
conn:subscribe( "test", sub )
25
26
uloop.run()