Fauna v10 .NET/C# Driver
1.0.1
Loading...
Searching...
No Matches
repo.git
Fauna
Core
FeedEnumerable.cs
Go to the documentation of this file.
1
using
Fauna.Types
;
2
3
namespace
Fauna.Core
;
4
5
10
public
class
FeedEnumerable
<T> where T : notnull
11
{
12
private
readonly
BaseClient
_client;
13
private
readonly
EventSource
_eventSource;
14
private
readonly CancellationToken _cancel;
15
19
public
string
?
Cursor
=>
CurrentPage
?.Cursor;
20
24
public
FeedPage<T>
?
CurrentPage
{
get
;
private
set
; }
25
26
internal
FeedEnumerable
(
27
BaseClient
client,
28
EventSource
eventSource,
29
CancellationToken cancel =
default
)
30
{
31
_client = client;
32
_eventSource = eventSource;
33
_cancel = cancel;
34
}
35
40
public
async IAsyncEnumerator<FeedPage<T>>
GetAsyncEnumerator
()
41
{
42
await
using
var subscribeFeed = _client.SubscribeFeed<T>(
43
_eventSource,
44
_client.MappingCtx,
45
_cancel);
46
47
while
(!_cancel.IsCancellationRequested && await subscribeFeed.MoveNextAsync())
48
{
49
CurrentPage
= subscribeFeed.Current;
50
yield
return
CurrentPage
;
51
}
52
}
53
}
Fauna.BaseClient
The base class for Client and DataContext.
Definition
IClient.cs:370
Fauna.Core.FeedEnumerable
Represents a Fauna Event Feed.
Definition
FeedEnumerable.cs:11
Fauna.Core.FeedEnumerable.CurrentPage
FeedPage< T >? CurrentPage
The latest page returned from the Event Feed enumerator.
Definition
FeedEnumerable.cs:24
Fauna.Core.FeedEnumerable.GetAsyncEnumerator
async IAsyncEnumerator< FeedPage< T > > GetAsyncEnumerator()
Returns an enumerator that iterates through the Feed.
Definition
FeedEnumerable.cs:40
Fauna.Core.FeedEnumerable.Cursor
string? Cursor
Current cursor for the Feed.
Definition
FeedEnumerable.cs:19
Fauna.Core.FeedPage
Represents the response from Fauna Event Feed requests.
Definition
FeedPage.cs:14
Fauna.Types.EventSource
Represents a Fauna EventSource for initializing Streams and Feeds.
Definition
EventSource.cs:9
Fauna.Core
Definition
Connection.cs:13
Fauna.Types
Definition
BaseRef.cs:3
Generated by
1.9.8