Bind replica document fetches through CultMesh snapshot endpoints

This commit is contained in:
Meta Vens 2026-06-27 17:45:18 +01:00
commit 6fbed1564f

View file

@ -69,11 +69,14 @@ public static class AetheriaVerseReplica
TimeSpan? responseTimeout = null)
where T : class
{
var documents = await CultMesh.FetchSnapshotDocumentsAsync<T>(
var surface = CreateSnapshotEndpoint(
endpoint,
CreateSnapshotOptions("aetheria-verse-replica", schemaIds, recordKeys, connectTimeout, responseTimeout),
AetheriaDocumentRegistry.CreateCultNetRegistry()).ConfigureAwait(false);
return documents;
"aetheria-verse-replica",
schemaIds,
recordKeys,
connectTimeout,
responseTimeout);
return await surface.FetchDocumentsAsync<T>(recordKeys, schemaIds).ConfigureAwait(false);
}
public static async Task RunReplicaAsync(
@ -212,6 +215,30 @@ public static class AetheriaVerseReplica
};
}
private static CultMeshSnapshotEndpoint CreateSnapshotEndpoint(
string endpoint,
string runtimeId,
IReadOnlyList<string>? schemaIds,
IReadOnlyList<string>? recordKeys,
TimeSpan? connectTimeout,
TimeSpan? responseTimeout)
{
var effectiveRuntimeId = string.IsNullOrWhiteSpace(runtimeId) ? "aetheria-verse-replica" : runtimeId;
return CultMesh.SnapshotEndpoint(
endpoint,
new CultMeshSnapshotEndpointOptions
{
Context = CultMesh.Verse("aetheria.remote", effectiveRuntimeId).Context,
DocumentRegistry = AetheriaDocumentRegistry.CreateCultNetRegistry(),
Request = CreateSnapshotOptions(
effectiveRuntimeId,
schemaIds,
recordKeys,
connectTimeout,
responseTimeout)
});
}
private static Task<CultMeshNode> OpenReplicaNodeAsync(
string replicaStatePath,
string endpoint,