/** * The production store ownership for one managed Oxigraph store: before each * spawn it reclaims the store from orphans (`oxigraph-orphan.ts`); after it, * it records the launch (`oxigraph-owner-record.ts`), and it adds the verified * Oxigraph once the launch is ready. It also tracks those writes, so * `close()` can wait for them. Built by the server for each start, with the * binary catalog its caller passes. * * No step rejects for an expected failure: the reclaim leaves a holder it * cannot stop to the spawn's own lock error, and a record that cannot be * written is logged, after which the reclaim falls back to the PID 1 rule. A * rejection would therefore be a defect, which the server treats as a failed * launch. */ import type { OxigraphBinaryLocations } from './oxigraph-binary.js'; import { type OxigraphLaunchRecord } from './oxigraph-owner-record.js'; import type { StoreHold } from './oxigraph-reclaim-policy.js'; import type { OxigraphStoreOwnership } from './oxigraph-store-launch.js'; /** The two store operations a launch is built from. */ export interface OxigraphStoreOwnershipSteps { /** * Stop orphaned Oxigraph processes that hold the store lock. `held` is why * the store may still be held by this node's Oxigraph, or null when it is * free for a new launch. */ reclaim(): Promise<{ held: StoreHold | null; }>; /** * Record a spawned launch as the store's owner; the returned record adds * the verified Oxigraph once the launch is ready. Null when there can be * no record for it (Windows, or a launch that could not be identified). */ recordLaunch(launcherPid: number): Promise; } /** What the server tells a store ownership about the store it launches. */ export interface OxigraphStoreOwnershipInput { location: string; binaryPath: string; /** The host the server launches on: it selects the reclaim's probes and the record. */ platform: NodeJS.Platform; log: (message: string) => void; } /** * The store ownership for one server start. `binaries` is what the reclaim * recognises as this node's Oxigraph (the resolved binary's * `oxigraphBinaryLocations`), defaulting to `binaryPath` alone. `steps` * replaces both the reclaim and the owner record at once (tests only), so a * caller never runs one of the production steps by leaving it out. * * It serialises its own lifecycle: a launch's reclaim and record writes are * tracked, `close()` waits for them, and after closing it runs at most one * more reclaim, when the last launch's wrapper had already exited and no * reclaim since has found the store free. */ export declare function createOxigraphStoreOwnership(opts: OxigraphStoreOwnershipInput & { binaries?: OxigraphBinaryLocations; steps?: OxigraphStoreOwnershipSteps; }): OxigraphStoreOwnership; //# sourceMappingURL=oxigraph-store-ownership.d.ts.map