Unify JSON-RPC servers and make JSON-RPC optional #23
Labels
No Label
bug
documentation
duplicate
enhancement
help wanted
invalid
maintenance
peach-lib
peach-network
peach-oled
peach-stats
peach-web
question
refactor
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: PeachCloud/peach-workspace#23
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Detailing some thoughts here from a conversation with @notplants :
Having multiple JSON-RPC microservices is great for modularity and interoperability but not so great for simplicity and minimising resource use.
One option is to group all JSON-RPC servers into one and allow selecting feature sets through configuration variables. For example, configuring the server to only expose RPCs for networking and stats while disabling the OLED features. This would mean we have a single binary running as a single process running on a single port; much easier in terms of devops, versioning, updating and system deployment.
An additional change would be to make the JSON-RPC server completely optional by separating the business logic of each microservice and placing it in a common library. Crate organisation might then look like this:
This would allow a single binary to bundle the entirety of the functionality currently exposed through the PeachCloud web interface (not including configuration, static assests etc.). One of the major advantages of this approach is optimising for minimal resource use.
A follow-on refactor would be to bundle
peach-menu
,peach-buttons
andpeach-oled
into a single binary for the physical menu system.I may have just created
peach-jsonrpc-client
(Saturday-evening desire to program).It only has four dependencies and provides RPC client functions for
peach-network
,peach-oled
andpeach-stats
. I've replacedsnafu
with a custom error implementation andserde
withminiserde
.The RPC client code for calling the dyndns-server still needs to be extracted from
peach-lib
.Just figured I'd mention this here so we know it's in the bag if / when we wish to do this refactor.