Reuse tauri IPC for calling commands in cli #14669
-
|
I have a rust application with lots of commands. My plan is to build a CLI just exposes those commands for dev support team that do not want to run the GUI. the first idea is to create another adapter and expose each command's logic but since I want to reuse the states of the main application, that would require me to cluster database and memory states (by redis and clustered version of sqlite). But A better idea is to make the CLI connect to the main process through websocket or IPC protocol, but that might be too much boilerplate for such a simple usecase. A cooler idea is to reuse the tauri IPC protocol that is used between rust and webview (I don't know if that is technically possible at all). and then simply map the incoming commands to the services. Is it possible? or do you know any better solution? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Tauris IPC can really only be used between rust and the webview as it uses webview specific apis but also because of many assumptions in the code. I used the interprocess crate some time ago and thought that it was fairly easy, for sure easier than trying to retrofit Tauri's ipc |
Beta Was this translation helpful? Give feedback.
Tauris IPC can really only be used between rust and the webview as it uses webview specific apis but also because of many assumptions in the code.
I used the interprocess crate some time ago and thought that it was fairly easy, for sure easier than trying to retrofit Tauri's ipc