Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"dogsdogsdogs",
"experiments",
"interactive",
"interactive/server",
"server",
"server/dataflows/degr_dist",
"server/dataflows/neighborhood",
Expand Down
21 changes: 21 additions & 0 deletions interactive/server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "ddir-server"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
description = "Interactive differential dataflow server: hold named arrangements live across DDIR program installs and drops."
publish = false

[[bin]]
name = "ddir_server"
path = "src/main.rs"

[lints]
workspace = true

[dependencies]
differential-dataflow = { workspace = true }
timely = { workspace = true }
interactive = { path = ".." }
diagnostics = { path = "../../diagnostics" }
tungstenite = "0.26"
39 changes: 39 additions & 0 deletions interactive/server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Live DDIR server

This crate transports the earlier `ddir-server` prototype onto the current
scope-tree DDIR interpreter. It does not use dynamic loading or a Rust FFI.

Run `cargo run -p ddir-server`, then open `interactive/server/console.html` or
connect a line-oriented client to TCP port 7777. The same protocol is available
over WebSocket on port 7778. Set `DDIR_BIND`, `DDIR_WS_BIND`, or
`DDIR_TICK_MS` to change those defaults; `DDIR_TICK_MS=0` disables automatic
progress while subscriptions are active. The current `diagnostics` crate is
connected on `DDIR_DIAG_PORT` (default 51371).

Every request can begin with an arbitrary request id. If omitted, the server
generates one. Responses are `<id> data ...`, followed by `<id> ok ...` or
`<id> err ...`. A `tail` remains active after its `ok` and ends when stopped.

The useful commands are `load`, `drop`, `list`, `peek`, `tail`, `stop`, `tick`,
and `exit`. `load` accepts an inline pipe-syntax program:

load graph begin
let edges = import "random:nodes=8,edges=12,seed=1,churn=1";
export "graph.edges" = edges;
graph end-load
tail graph.edges

The old binding spelling is also accepted during upload, so
`edges=random(seed=1,arity=2,range=8,count=12,churn=1)` can redirect the local
import named `edges`. It is translated to the current content-addressed source
name. Such a source is deterministic: it begins with a fixed-size window into
an infinite hash-derived sequence and replaces `churn` rows on every tick.

Automatic ticking happens only while at least one tail is active. This makes a
live demonstration move without assigning input durability semantics to DDIR.
Explicit `tick [n]` remains available for reproducible sessions.

The prototype's `--explain`/`query` path is intentionally not ported yet. It was
tied to the former flat IR and should instead be rebuilt around the current
scope-tree explanation work. The live server reports an error rather than
silently changing those commands' meaning.
Loading
Loading