Public beta — this package is versioned at
0.x; its API may change between minor versions.
The workspace-keyed socket/pipe transport for the Rush daemon (rushd):
- Workspace keys —
sha256(canonicalRepoRoot + rushVersion + startupOptions), so distinct workspaces, Rush versions, or startup options resolve to distinct daemon endpoints while the same workspace stays stable across runs. - Per-user path derivation — Unix domain sockets in
/tmp/rushd-<uid>/on POSIX, or in$RUSHD_RUNTIME_DIR/rushd-<uid>/when that variable is an absolute path, and\\.\pipe\rushd-<key>named pipes on Windows.TMPDIRandXDG_RUNTIME_DIRare not consulted, because they differ between the shells, jobs and services of one user. A daemon resolves its paths with the same rule, and a client that starts one passes the folder it chose asRUSHD_RUNTIME_DIR. The folder must be a directory (not a symbolic link) that the user owns; one that others can open is made owner-only (0700). The socket path must fit in a socket address, at most 108 bytes on Linux and 104 on other POSIX platforms, because Node.js silently truncates a longer one; a longer path is refused withsocketPathTooLongbefore the folder is checked or created. netlistener and connector — framed with@rushstack/rush-daemon-protocol, with backpressure-aware writes and serialized async frame handlers for inbound flow control.sendFrameWrittenAsyncresolves only once the operating system holds the frame, so the peer can read it even if this process exits next. The socket is paused while a handler runs, and a failed write or a reset from the peer discards the bytes that wait in its buffer;closedAfterReadingAllsays whether a closed connection read every byte that the peer sent.- PID/lockfile handling — stale sockets and dead PIDs are detected (two-factor: PID liveness
plus a connect probe) and reclaimed without manual cleanup. On Linux, a reclaim first stops the
operations that the dead daemon left running. Both
reclaimStaleDaemonAsyncandDaemonFrameListener.listenAsyncreport each set of stopped process groups toonOrphansReaped, or, without it, as aRUSH_DAEMON_ORPHANS_REAPEDprocess warning. A recorded operation group that the reclaim cannot prove is still the dead daemon's gets no signal. When such a group still has a live process, it is passed toonOperationGroupLeftRunning, if given, with the first check it failed;formatOperationGroupLeftRunningdescribes it in one line. - Two-phase shutdown —
stopAcceptingAsync()stops admission and waits for connections while retaining ownership. Hosts release the endpoint withcloseAsync()after their resources have finished disposing. A live owner prevents rebinding even when its socket has already closed; repeated closes cannot remove a successor's endpoint. - Owner-safe publication — a listener binds a private name and hard-links it to the socket path, so it never replaces a live peer's socket; the runtime folder's file system must support hard links. On close it removes the socket and ownership record only while they are still the files it created, so a predecessor that shuts down late never removes a successor's endpoint.
Part of the Rush 6 / rushd re-architecture: microsoft/rushstack#5894.
- CHANGELOG.md - Find out what's new in the latest version
- API Reference
@rushstack/rush-daemon-transport is part of the Rush Stack family of projects.