Add synchronous CultMesh document reads
This commit is contained in:
parent
1753dfbb92
commit
b6d4ebc920
2 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue