gomuks icon indicating copy to clipboard operation
gomuks copied to clipboard

TUI: Embedded backend mode

Open tulir opened this issue 2 months ago • 5 comments

tulir avatar Oct 26 '25 23:10 tulir

What was the envisioned plan regarding this issue?

The easiest way would probably be to run a goroutine that starts the backend server and make the TUI goroutine connect to its socket. It feels a bit strange to exchange data between goroutines over the system's socket API but it would at least simplify the setup of gomuks terminal quite a lot.

Maybe a better version would use the net.Pipe to make the connection between the two goroutines more direct?

I think that I would like to try to implement the first solution soon, what do you think about it?

n-peugnet avatar Nov 27 '25 15:11 n-peugnet

It'll just call the functions directly rather than using any networking

tulir avatar Nov 27 '25 15:11 tulir

So completely replacing pkg/rpc/client with pkg/hicli? I agree that it would be ideal, but also a lot more work, and I don't think that I will have enough time for this, so it would be completely up to you.

n-peugnet avatar Nov 27 '25 16:11 n-peugnet

No, only pkg/rpc would be replaced, not the client. Perhaps even only the Request method and not the rest of the struct

tulir avatar Nov 27 '25 16:11 tulir

OK I get it, makes sense. But to me it still looks more complicated than running the server in a goroutine. As you plan on keeping the pkg/rpc/client abstraction, I think I will experiment with my proposition as a first step that could be optimised later. The performances will not be worst than currently and it would already make the setup a lot simpler.

n-peugnet avatar Nov 27 '25 16:11 n-peugnet