From e639f37f52d2b1ef1ada8147b11b931102ade9eb Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Sun, 9 Oct 2022 12:41:17 +0900 Subject: [PATCH] README: Use uipc in PubSub example instead of ipc The readme uses the ipc module to explain how to implement simple pubsub-based messaging using toolbox. However, the ipc module is somewhat awkward to configure because it uses GPG and requires the user to generate unencrypted keys. This commit modifies the readme to introduce the uipc module instead of the ipc module, since the former is easier to set up. --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index adc3d48..6510cdb 100644 --- a/README.md +++ b/README.md @@ -19,24 +19,24 @@ that ship with toolbox, or create your own ones. All you have to do is source *toolbox.sh* and you can start using the `include()` function. For example, the following code is a -minimal publisher using the *ipc* module. +minimal publisher using the *uipc* module. . toolbox.sh - include "ipc" + include "uipc" - endp=$(ipc_endpoint_open) - ipc_endpoint_publish "$endp" "mytopic" "Hello world" + endp=$(uipc_endpoint_open) + uipc_endpoint_publish "$endp" "mytopic" "Hello world" And this is the corresponding subscriber. . toolbox.sh - include "ipc" + include "uipc" - endp=$(ipc_endpoint_open) - ipc_endpoint_subscribe "$endp" "mytopic" + endp=$(uipc_endpoint_open) + uipc_endpoint_subscribe "$endp" "mytopic" - if msg=$(ipc_endpoint_recv "$endp"); then - data=$(ipc_msg_get_data "$msg") + if msg=$(uipc_endpoint_recv "$endp"); then + data=$(uipc_msg_get_data "$msg") echo "Received message: $data" fi @@ -54,7 +54,7 @@ used for. | conf | Configuration handling | | git | Interacting with git repositories | | inst | Writing daemons | -| ipc | Message-based IPC | +| ipc | Message-based IPC (GPG-signed messages) | | is | Checking the value of variables | | json | Handling JSON data | | log | Logging and debugging | @@ -62,6 +62,7 @@ used for. | opt | Command line parsing | | queue | "Thread"-safe FIFOs | | sem | Process synchronization (similar to POSIX semaphores) | +| uipc | Message-based IPC (unsigned messages) | | wmutex | Weak (owner-less) locks | -- 2.47.3