Closed A1Liu closed 9 months ago
use IDs to track reference lifetimes, and do our own garbage collection
Arc
~Runs keep Arc
to their inputs, stream results as needed~
Cells hold references to their currently active runner
Poll cell using cell ID instead of run ID
Add cursors + buffering to runners
Graph is separate data structure between cells, not runners
Graph created during startup using start
method of the run command
pollCell(CellId) -> { uuid of runner, results, etc. }
- frontend should poll cells instead of commands/runners
RunCtx.read_from_cell()
- Reads the current runnable from the cell and adds the dependency relation to the RunGraph
Runner { generation: u32, } // generation counter prevents cycles
-
Re-runs are serialized, waiting until all dependencies are re-started before modifying the graph with the next set of modifications
If a command is still running while a graph edit is happening, it must be restarted (can consider doing something more complicated in the future, but whatever for now)
Need to use RunGraph
instead of CellGraph
so that there's no race conditions which produce implicit cycles
Also probably need a version ID on the generation counter
Maybe instead of having super complicated threading model, use ideas from tick system in S.js to serialize dependency graph production
petgraph::GraphMap
- https://github.com/petgraph/petgraph
Use start() -> RunResult
to synchronously create graph w/ initial dependencies mapped out
Plan:
notify
crate or tail -f -c +1 FILE
)
Tauri events: https://tauri.app/v1/guides/features/events/