The view
What it is
The view is a web page that draws the network: every node on it as a card, and on each card the loops it runs. A node is anything that answers the census: a board, a command-line prompt, a Max patch, and the page itself. A card is drawn from what the node last said, never from a model the page keeps, so what you see is what the node reported.
Each card shows the node’s name and address; its loops, each with a mark for its state (● runs again within its period, ▶ running now, ‖ held, ■ parked); the functions and values someone put there, with their text; and the count of names the host gives, which opens into a searchable list. The column on the left, “Kept here”, holds the loops, functions and values you write on the page. The line at the bottom says the last thing done, and opens into everything done, each with the line of osen it ran.
Start it
In hosts/unix.o.se, with o.se built and web.o.se built beside it:
tools/view.sh
That one prompt runs the census, serves the page, bridges the browser to
the network, and is a node itself, with a card. It prints the address to
open, http://localhost:8090/view/?ws=ws://localhost:8091. Run it again
in another terminal and the second prompt joins as another node;
--id kitchen names one. A board on the network announces itself when
it boots, and a patch with [o.se.node 7401] in it is a node too.
By hand it is three terminals: at a prompt, ("examples/census.osen")
/o/load, (8888) /o/serve; then tools/ws-bridge.sh --udp 9990 --ws 8091
--to 127.0.0.1:8888; then make serve PORT=8090 in web.o.se; and the
same address.
What you can do
Every gesture is a program sent to the node, followed by the census’s question to it, and the card shows the gesture pending until the node itself lists the result; the line of osen that ran is shown with it. A gesture is sent again every two seconds until it is seen done, and given up after six sends.
- Write a loop with “+ a loop”: a name, a period, what it starts
with and what it does each time. Drag it onto a card and the node
files it:
/n : 0, ({ /n : (/n, 1) /o/add }, 500, "/count") /continue/every. - Write a function or a value and drag it onto a card: it is bound among the node’s own names, with its text beside it, so the card can show what was put there and a loop there can call it.
- Move a loop by dragging it from one card to another; hold ⌥ to copy. The source holds the loop and sends a copy; when the destination lists it, the source stops its own. The loop carries its state, so a count goes on from where it was, and the names it calls mean what the new node binds them to. Drag it onto the page’s own card and it runs in the browser.
- Stop a loop by dragging it onto the strip that appears under its card, or with the × on its row.
- Open a loop to change its period, hold it, run one period, or release it. A held loop runs only when told to.
- Give a loop a name by dropping a function or a value on its row: it is bound in the loop’s own environment, read from its next period, and travels with the loop.
- Name a card by clicking its title; the name is this view’s only.
A loop whose period fails is drawn parked, ■, kept as it stopped. It can be dragged, held, released and stopped like any other. Fixing it from the view is not something the page does: a copy is fetched at a prompt and sent back, as Between hosts shows.
Where it stands
The page’s tests run its core against machines in the page standing in
for the prompt and the nodes, make test in web.o.se; the real network
is run by hand. A board holds two loops at a time, and a change to a
loop when both slots are full is refused, which the card can only report
as given up.