Switch to a client/server architecture#46
Conversation
46f8635 to
698496a
Compare
|
I would like to test the new architecture, but I get stuck at building the BTW here' the error I get when running the script:
After a quick debug I've noticed that the script isn't generating the |
|
A wild idea: Would it be possible to completely split client from server (two different binaries) and make them do IPC via socket (only when required, for performance reasons). If that is possible, then I think it would be possible to install |
|
@alexandernst We are completely separating the client from the server in this PR as you describe, but the server needs to be running locally for there to be acceptable latencies. We do intend to enable server to server communication to enable the kind of experience you're describing, but we can't just connect the view directly to a remote server without unacceptable lag in the UX. |
|
This sounds like a 21st century Xfree. Do you expect good latency using client/server architecture? |
|
@NachE if the server is local as we’re currently designing this then yes, latency should be minimal. Communications with a remote server will be routed through the local server and use CRDTs to avoid latency where it would be problematic. |
|
|
||
|  | ||
|
|
||
| The protocol between the window and the server in inspired by the [Flux application architecture](https://facebook.github.io/flux/), though it's probably different in some ways due to the particular needs of Xray. |
There was a problem hiding this comment.
s/in inspired by/is inspired by
dfecbff to
d9bf5f3
Compare
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored-by: Nathan Sobo <nathan@github.com>
Co-authored by: Nathan Sobo <nathan@github.com>
Co-authored by: Nathan Sobo <nathan@github.com>
Co-authored by: Nathan Sobo <nathan@github.com>
In Client::poll, we need to loop when polling the socket and the channel until we receive a NotReady event. This ensures that the parent task is woken up again when we receive more input. Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored by: Nathan Sobo <nathan@github.com>
This is a more OO approach that simplifies the interface of message-handling methods. Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
This ensures that the future that forwards window updates is dropped when the window client disconnects. Co-authored-by: Antonio Scandurra <as-cii@github.com>
If a new window client appears, we create a new window update stream and cause any previous update streams to terminate.
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
We won't have much that isn't a component, so this makes things less verbose. Worst case we can put all the components in a folder. Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
We did a bunch of other changes in this commit to the styling framework while debugging an issue. We're just going to roll with it. Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored-by: Nathan Sobo <nathan@github.com>
This way, the view can call `add_view` inside of `did_mount` without double-borrowing the window Inner.
Also, remove the `workspace` field on Windows and simply add the workspace as the window's root view from the outside.
The call to setState was causing the editor to render twice for each scroll event: once due to the state update and a second time shortly afterward due to the message from the server.
Co-authored-by: Nathan Sobo <nathan@github.com> Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Now that we use a client/server architecture, we don't need bindings into V8. We may resurrect this code later if we want to provide bindings to an embedded V8 VM in the server. Co-authored-by: Antonio Scandurra <as-cii@github.com>
|
We've changed the roadmap on this PR a bit to cut scope. Previously, we were thinking of including the file finder experience as part of this PR. Thinking about the file finder was useful in driving out the design of our window / views abstraction, and we made decent progress toward implementing it, but we've decided to drop it from this PR for now and just render an example editor. That gets us back to parity with master. We should be able to merge this week, and then we can pick up the file finder work on another branch. |
This name more accurately reflects the order of operations.
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
As discussed in the update for March 12, we are switching Xray to a client/server architecture that places as much logic as possible in a central server process. This PR is the implementation of that plan.
I'm including a detailed explanation of the contents of this PR in a markdown document that will become a permanent part of our documentation once this is merged. Hopefully it's high-level enough that we have a reasonable chance of keeping it updated.
Tasks
ViewHandles@cmyr, since you were interested in any PRs related to our approach to the client/server protocol, I'm cc'ing you on this PR.