Bind replica document fetches through CultMesh snapshot endpoints
This commit is contained in:
parent
2cb8e10a3c
commit
6fbed1564f
1 changed files with 31 additions and 4 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue