summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 00:44:58 -0300
committerGabriel Schneider <[email protected]>2026-11-17 10:06:26 -0300
commit67fa2a1f2e6057bbce7441a16ebab84848f623ae (patch)
tree515f38c20566fb14f126d057fb7ad11f14349c96 /README.md
parent0702e33bcfadf0abd9ccbaa8b681a19a84c332fe (diff)
downloadcloud9-67fa2a1f2e6057bbce7441a16ebab84848f623ae.tar.gz
cloud9-67fa2a1f2e6057bbce7441a16ebab84848f623ae.zip
Fsys: a blocking client on a socket, by path, with the server's words
Every program that serves a cloud9 tree should be drivable through it from its own binary and from agents, and pardes, 9ns and pardes's Python tests each carried a blocking client of their own. Fsys is the one the library lacked, plan9port's lib9pclient over `Client`: dial a name posted in the registry (a subdirectory entry such as pardes/main included), unix!PATH or tcp!HOST!PORT; open, create, remove, stat, read, write and clunk by path and fid; readFile, writeFile and ask (write, then read the answer on the same open from the start, as Plan 9 reads /net/cs) streaming into a std.Io.Writer, flushed per answer, so an event file whose reads park streams as it comes. A refusal is error.Refused and said() holds the server's words, which a mount would have turned into an errno. Taken from pardes's Client (src/9p_io.zig): the walk sent ahead of the request that uses its fid, the clunk not waited for, and the answers of both checked or dropped on the way to the request's, so an open, a stat or a remove is one round trip; error words kept as the server said them. Not taken: its kept-connection table, flights of read-ahead, the stat-length end of file and its pardes-only dials. From 9ns: the chunked read/write loops and the iounit. Buffers inline (2 x 64 KiB), no allocator, std.Io streams only, so it builds without libc. TestTree.zig is a small tree on serve.Runner for these tests and the next change's. Tests over a Unix socket and TCP against cloud9's own engine: whole files longer than a message, stats, walks longer than 16 names, a missing first name and a walk short of its names refused in the server's words, a refused write whose words reach the caller, a short read that is not the end, ask, a held read streaming three chunks flushed one at a time, a server that hangs up mid-read, create and remove, a directory decoded as entries, dial by posted name and a name that climbs out of the registry.
Diffstat (limited to 'README.md')
-rw-r--r--README.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/README.md b/README.md
index 6e0d488..a474147 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,15 @@ Submit `.version` first. Drain `output()` through your transport and report the
number sent with `wrote()`. Feed received bytes using `push()` and collect tagged
results with `take()`. All base requests are available through `Client.Request`.
+`Fsys` is that client on a socket, blocking, one call at a time (plan9port's
+lib9pclient): `dial(io, env, "pardes/main", user)` takes a name posted in the
+registry, `unix!PATH` or `tcp!HOST!PORT`; then `open`, `create`, `remove`,
+`stat`, `read`, `write` and `clunk` by path and fid, and `readFile`,
+`writeFile` and `ask` (write, then read the answer on that open from 0) for
+the common shapes, streaming into a `std.Io.Writer`. A refusal is
+`error.Refused` and `said()` holds the server's words. Its buffers are in the
+struct: no allocator.
+
For a server, call `Server.receive()` after `push()`. A request borrows the input
until `release()`. After releasing backend fids and canceling outstanding work,
answer Tversion with `negotiate()`. Answer other requests with `reply()`. The