mirror of
https://gitee.com/BDWare/router-backend
synced 2025-01-10 01:44:05 +00:00
feat: add event publishing
add NodeCenterActions.publishEvent
This commit is contained in:
parent
10de4e0d5f
commit
0fd984d5fd
@ -1649,6 +1649,16 @@ public class NodeCenterActions {
|
||||
resultCallback.onResult(ret.toString());
|
||||
}
|
||||
|
||||
@Action(async = true)
|
||||
public void publishEvent(JsonObject args, final ResultCallback rcb) {
|
||||
try {
|
||||
args.addProperty("action", "publishEventFromCenter");
|
||||
nodeInfos.values().iterator().next().connection.controller.sendMsg(JsonUtil.toJson(args));
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("publishEvent error! " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static class ResultCollector extends ResultCallback {
|
||||
private final ResultCallback committer;
|
||||
List<String> result = new ArrayList<>();
|
||||
|
Loading…
Reference in New Issue
Block a user