We need to find a sustainable path to develop the builder in world without compromising future plans and also enabling experimenting with the static scene definition initiatives and new SDK.
The domain of the problem can be divided in three big chunks:
Today we are deciding on the State management.
In this approach the owner of the "edited" state is the renderer.
sequenceDiagram
participant user
participant kernel
participant worker
participant renderer
participant p2p
user->>kernel: load scene
kernel->>worker: create worker
worker->>worker: load scene
worker-->>renderer: inform state
sequenceDiagram
participant user
participant kernel
participant worker
participant renderer
participant p2p
p2p-->>kernel: edition beacon {scene xy}
kernel-->>renderer: edition mode
renderer-->>worker: kill worker
p2p-->>renderer: process update
user->>renderer: perform changes (if allowed)
p2p-->>renderer: process update
Save the current snapshot of the static scene
sequenceDiagram
user-->>renderer: edition mode
renderer-->>worker: kill worker
user->>renderer: perform changes
renderer->>renderer: process changes 🔧
user->>renderer: save
renderer->>kernel: save {serialized state}
kernel->>builder_server: generate code and store
After a change in state (i.e. builder action)
sequenceDiagram
user-->>renderer: edition mode
renderer-->>worker: kill worker
user->>renderer: perform changes
user->>renderer:
user->>renderer:
renderer->>renderer: process changes 🔧
renderer-->>p2p: update-msg
From other connected scenes.
In this case we would receive updates only on edition mode.
sequenceDiagram
user-->>renderer: enter edition mode
renderer-->>worker: kill worker
p2p-->>renderer: update-msg
renderer->>renderer: process changes 🔧
In this approach, the scene code is owner of the state at all times.
sequenceDiagram
participant user
participant kernel
participant worker
participant renderer
participant p2p
user->>kernel: load scene
kernel->>worker: create worker
worker->>worker: load scene (JSON)
worker-->>renderer: inform state
worker->>worker: connect to synchronization bus
worker->>kernel: init p2p bus
From other connected scenes.
In this case we would receive updates either we are editing or not.
sequenceDiagram
participant user
participant kernel
participant worker
participant renderer
participant p2p
p2p-->>worker: update-msg
worker->>worker: process changes 🔧
worker-->>renderer: inform state
After a change in state (i.e. builder action)
sequenceDiagram
participant user
participant renderer
participant worker
participant p2p
participant kernel
user->>renderer: perform changes
renderer-->>p2p: broadcast update-msg
renderer->>worker: update-msg
worker->>worker: process changes 🔧
After a change in state (i.e. builder action)
sequenceDiagram
participant user
participant renderer
participant worker
participant p2p
participant kernel
user->>renderer: perform changes
renderer->>worker: update-msg
worker->>worker: process changes 🔧
worker-->>p2p: broadcast update-msg
Save the current snapshot of the static scene
sequenceDiagram
participant user
participant renderer
participant worker
participant p2p
participant kernel
user->>renderer: save state
renderer->>worker: save
worker->>worker: serialize scene
worker->>worker: save JSON (POST?)
sequenceDiagram
user->>worker: kill worker
user->>new_worker: create for edition (scene xy)
new_worker->>content_server: get JSON (scene xy)
content_server->>new_worker:
new_worker->>renderer: initial state
renderer-->>new_worker: update-msg
renderer-->>p2p: update-msg (for broadcast)
p2p-->>new_worker: update-msg