uwe-app / app

Universal web editor
https://uwe.app
0 stars 0 forks source link

Multi-window IPC #475

Closed tmpfs closed 3 years ago

tmpfs commented 3 years ago

Support multi-window IPC using interprocess.

Whilst it is tempting to use the native multi-window support exposed by wry, it won't work due to our requirement to support .uwe-version to set the compiler version for a project.

By adding IPC we can communicate from a supervisor process to child processes that will be used to compile each project and provide their own native window for the project.

The CLI API then becomes:

uwe editor

To launch the supervisor window allowing listing, creation and removal of projects.

And for a single project:

uwe editor /path/to/project

The supervisor will then launch child windows using the above command and children will connect to the supervisor over IPC.

tmpfs commented 3 years ago

Child windows should be able to be run independent of the presence of a supervisor so it is not an error if they cannot connect to a supervisor server.

tmpfs commented 3 years ago

Initial work on this has been done here. The interprocess library was not a good fit due to a bug with blocking on the write half of the socket, after switching to Unix sockets using tokio the IPC mechanism works as expected.

Some more effort is required to make this really robust before we can use it here but it paves the way to spawning a child process for each project that will respect the .uwe-version file.

tmpfs commented 3 years ago

I am pretty confident that psup will do the job so closing this now.