SrvCapable
Defined in: packages/core/src/kernel/types.ts:1532
A fileserver that can hold posted Fileserver references — the /srv registry.
Implement to host a Plan 9-style /srv: a discoverable directory of Fileserver references that other processes can mount.
Remarks
Section titled “Remarks”Canonical impl is srvFS(), mounted at /srv at boot. Bins post a server
by name, others read /srv to discover it, then mount it into their own
namespace — the mechanism that makes the mount table dynamic without
privileged boot-time mounts.
Example
Section titled “Example”import { memoryFS, srvFS, isSrvCapable } from '@fishnet/core'const srv = srvFS()if (isSrvCapable(srv)) { srv.postServer('cache', memoryFS()) srv.getServer('cache') srv.removeServer('cache')}Methods
Section titled “Methods”getServer()
Section titled “getServer()”getServer(
name):Fileserver|undefined
Defined in: packages/core/src/kernel/types.ts:1539
Look up a posted server by name.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Fileserver | undefined
Invariant
Section titled “Invariant”Returns undefined when nothing is posted under name — does
NOT throw; callers treat absence as a normal outcome
postServer()
Section titled “postServer()”postServer(
name,server):void
Defined in: packages/core/src/kernel/types.ts:1546
Post a Fileserver under a name.
Parameters
Section titled “Parameters”string
server
Section titled “server”Returns
Section titled “Returns”void
Invariant
Section titled “Invariant”Replaces any existing post at that name; observers (see
SrvObservable) see a single 'post' event even on replacement
removeServer()
Section titled “removeServer()”removeServer(
name):void
Defined in: packages/core/src/kernel/types.ts:1553
Remove a posted server.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Invariant
Section titled “Invariant”Safe to call when name has no post — no-op, does not emit an
observer event in that case