Add synchronous CultMesh document reads

This commit is contained in:
Meta Vens 2026-06-27 16:03:10 +01:00
commit b6d4ebc920
2 changed files with 16 additions and 0 deletions

View file

@ -961,6 +961,12 @@ namespace GameCult.Mesh
return _feed.SnapshotAsync(CultMeshDocumentQueryParameters.Empty);
}
/// <summary>Reads the latest document snapshot synchronously for host APIs that cannot be async.</summary>
public TDocument Latest()
{
return LatestAsync().ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>Watches coherent document snapshots.</summary>
public Observable<TDocument> Watch()
{
@ -1140,6 +1146,13 @@ namespace GameCult.Mesh
return Document<TDocument>().LatestAsync();
}
/// <summary>Reads one typed document synchronously by CLR type or same-schema alias.</summary>
public TDocument Latest<TDocument>()
where TDocument : class
{
return Document<TDocument>().Latest();
}
/// <summary>Watches one typed document by CLR type or same-schema alias.</summary>
public Observable<TDocument> Watch<TDocument>()
where TDocument : class