PersistenceHost
Serves the orchestrator's IPersistenceStore to workers over the orchestrator's HTTP server, so a worker needs no database driver of its own (RemotePersistenceStore is its client).
Nebula · Packages/com.1by3.nebula/Runtime/Persistence/PersistenceHost.cspublic sealed class PersistenceHostServes the orchestrator's IPersistenceStore to workers over the orchestrator's HTTP server, so a worker needs no database driver of its own (RemotePersistenceStore is its client). Every request is handled on the main thread from the orchestrator's command pump, which is where the store's callbacks land: a read returns OrchestratorHttpServer.Response.Pending and completes when the store answers, usually on the next tick. A write answers the same way, once the store's IPersistenceStore.WhenWritten barrier says the backend has it, so a worker's RemotePersistenceStore.WhenWritten is a real durability barrier and not just proof of delivery.
POST /api/store/save{"records":[...]},POST /api/store/delete{"keys":[...]},POST /api/store/clearGET /api/store/record?key=,GET /api/store/allPOST /api/store/containers{"ids":[...]}: the records of up toMaxContainersPerLoadcontainers, as one{"records":[...]}listPOST /api/store/carried{"keys":[...]}: what up toMaxCarriersPerLoadcarriers hold, as one{"records":[...]}listGET /api/store/count?scope=&container=: how many records a scope (optionally one of its containers) holds, without reading themGET /api/store/status: backend, whether it is connected, how many records it holds
Requests carry the mesh token in X-Nebula-Token when the mesh has one.
Constructors
PersistenceHost
public PersistenceHost(IPersistenceStore store, string token);Fields
Prefix
public const string Prefix = "/api/store";MaxContainersPerLoad
public const int MaxContainersPerLoad = 256;Most container ids one POST /api/store/containers request may name. A larger request is refused with HTTP 400; RemotePersistenceStore.LoadContainers splits a longer list into requests of this size, and SqlPersistenceStore queries the database in chunks of this size.
MaxCarriersPerLoad
public const int MaxCarriersPerLoad = 256;Most carrier keys one POST /api/store/carried request may name. A larger request is refused with HTTP 400; RemotePersistenceStore.LoadCarried splits a longer list into requests of this size, and SqlPersistenceStore queries the database in chunks of this size.
Properties
Store
public IPersistenceStore Store { get; }Methods
TryHandle
public bool TryHandle(OrchestratorHttpServer.Request req, out OrchestratorHttpServer.Response response);Main thread: handle req when it addresses the store. False for any other request.