Skip to content

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.

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.

import { memoryFS, srvFS, isSrvCapable } from '@fishnet/core'
const srv = srvFS()
if (isSrvCapable(srv)) {
srv.postServer('cache', memoryFS())
srv.getServer('cache')
srv.removeServer('cache')
}

getServer(name): Fileserver | undefined

Defined in: packages/core/src/kernel/types.ts:1539

Look up a posted server by name.

string

Fileserver | undefined

Returns undefined when nothing is posted under name — does NOT throw; callers treat absence as a normal outcome


postServer(name, server): void

Defined in: packages/core/src/kernel/types.ts:1546

Post a Fileserver under a name.

string

Fileserver

void

Replaces any existing post at that name; observers (see SrvObservable) see a single 'post' event even on replacement


removeServer(name): void

Defined in: packages/core/src/kernel/types.ts:1553

Remove a posted server.

string

void

Safe to call when name has no post — no-op, does not emit an observer event in that case