diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-03-03 23:39:55 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-03-07 00:01:43 +0100 |
commit | 1cb04f9b76e2710ca55909b61fc81d9b3c98bb2a (patch) | |
tree | 8f33c2d790305ea1e5415ec7e22e47c84511eefe /lexer.c | |
parent | 0e859748a4e00cfad3bc50e386a06622066ee994 (diff) |
ubus: add object publishing, notify and subscribe support
Extend the ubus binding to cover ubus object publishing, notifications on
objects, as well as subscriber APIs.
Instantiating ubus objects:
obj = conn.publish("objname", {
methodname: {
args: { ...argspec... },
call: function(request) { ...method handler... }
},
...
}, function() { ...subscription status change handler... });
obj.notify(...);
obj.remove();
Emitting notifications:
obj.notify("notificationtype", { ...notification data... },
function(type, data) { ...data callback... },
function(idx, ret) { ...status callback... },
function() { ...completion callback... },
100 /* timeout */
);
Instantiating subscribers:
sub = conn.subscriber(
function(notify) { ...notification handler... },
function(id) { ...object gone handler... }
);
sub.subscribe("objname");
sub.unsubscribe("objname");
sub.remove();
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lexer.c')
0 files changed, 0 insertions, 0 deletions