Replies: 1 comment
-
@AsamK do you have any suggestion with respect to this? thanks! 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hello, as I have briefly explained in this sub-discussion, I would like to get some pointers from the community with respect to the way in which one can code the simplest possible bot that wraps the JSON-RPC
signal-cli
functionality.the simplest possible bot that wraps the normal-mode (non-JSON, non-DBUS)
signal-cli
features might be, for example, a cronjob that periodically fetches new messages:with the new JSON-RPC mode, the architecture of this simple loop should change considerably.
having a single
signal-cli
process that ingests JSON data from a file/pipe and produces output to a file/pipe is relatively straightforward, but how to design the process that parses such data?one of the benefits of the cronjob, for example, is that I can push a new version of the script (e.g.
my-signal-parser
above) and thus have an effortless continuous deployment without data loss.this is not true anymore if I have a parser process that is continuously coupled to the receiver process, e.g.:
I guess I could have something like an intermediate message wrapper, e.g.:
in such an example, the continuous parser simply transfers the piped output into a different file that changes every minute, while the cronjob can execute every few minutes and simply ingest message files that are now static and act as necessary.
the continuous parser does not need lots of maintenance and can thus be spun up indefinitely, whereas the usual cronjob is executed anew as per schedule, as thus easily benefits from updated versions.
does this approach make sense?
how would the other folks here go about and structure a bot around the JSON-RPC mode?
I am aware of the go-based Docker REST API, but it's not what I would like to do at present.
it goes without saying that I would like to design something close enough to my original bot so that I could reuse most of my code.
PS: please take all of this as a pseudo-code exercise, I know these bash lines wouldn't pass
shellcheck
! 😉Beta Was this translation helpful? Give feedback.
All reactions