From a16949f646b14aab9433ef0b8f72adf96aa045d2 Mon Sep 17 00:00:00 2001 From: "javier.jorge" Date: Thu, 9 May 2024 17:29:12 -0300 Subject: [PATCH 1/2] shared-state-async: add publisher call interface --- .../files/usr/libexec/rpcd/shared-state-async | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/shared-state-async/files/usr/libexec/rpcd/shared-state-async b/packages/shared-state-async/files/usr/libexec/rpcd/shared-state-async index fdcb6ed04..799142f34 100755 --- a/packages/shared-state-async/files/usr/libexec/rpcd/shared-state-async +++ b/packages/shared-state-async/files/usr/libexec/rpcd/shared-state-async @@ -11,7 +11,7 @@ sinc_args="" case "$1" in list) - echo '{ "sync": { "data_type": "str", "peers_ip": "str" }, "get": { "data_type": "str" } }' + echo '{ "sync": { "data_type": "str", "peers_ip": "str" }, "get": { "data_type": "str" }, "publish": { "data_type": "str" } }' ;; call) # source jshn shell library @@ -33,6 +33,10 @@ case "$1" in shared-state-async sync $data_type ${peers_ip//,/ } > /dev/null 2>&1 echo {\"data\": {} , \"error\": $? } ;; + publish) + /usr/share/shared-state/publishers/shared-state-publish_$data_type > /dev/null 2>&1 + echo {\"data\": {} , \"error\": $? } + ;; *) echo '{\"data\" {} ,\"error\" = "Method not found"}' ;; From 53005777608e84d312a758ec052ed50fcbc463a8 Mon Sep 17 00:00:00 2001 From: selankon Date: Fri, 10 May 2024 16:01:43 +0200 Subject: [PATCH 2/2] shared-state-async: expose publish all --- .../files/usr/libexec/rpcd/shared-state-async | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/shared-state-async/files/usr/libexec/rpcd/shared-state-async b/packages/shared-state-async/files/usr/libexec/rpcd/shared-state-async index 799142f34..1dac5b03c 100755 --- a/packages/shared-state-async/files/usr/libexec/rpcd/shared-state-async +++ b/packages/shared-state-async/files/usr/libexec/rpcd/shared-state-async @@ -11,7 +11,7 @@ sinc_args="" case "$1" in list) - echo '{ "sync": { "data_type": "str", "peers_ip": "str" }, "get": { "data_type": "str" }, "publish": { "data_type": "str" } }' + echo '{ "sync": { "data_type": "str", "peers_ip": "str" }, "get": { "data_type": "str" }, "publish": { "data_type": "str" }, "publish_all": { } }' ;; call) # source jshn shell library @@ -37,6 +37,10 @@ case "$1" in /usr/share/shared-state/publishers/shared-state-publish_$data_type > /dev/null 2>&1 echo {\"data\": {} , \"error\": $? } ;; + publish_all) + shared-state-async-publish-all > /dev/null 2>&1 + echo {\"data\": {} , \"error\": $? } + ;; *) echo '{\"data\" {} ,\"error\" = "Method not found"}' ;;