Fauna v10 .NET/C# Driver
0.3.0-beta
Loading...
Searching...
No Matches
Fauna
Core
StreamEnumerable.cs
Go to the documentation of this file.
1
using
Fauna.Types
;
2
using
Stream
=
Fauna
.
Types
.
Stream
;
3
4
namespace
Fauna.Core
;
5
6
public
class
StreamEnumerable
<T> where T : notnull
7
{
8
private
readonly
BaseClient
_client;
9
private
readonly
Stream
_stream;
10
private
readonly CancellationToken _cancel;
11
12
public
string
Token
=> _stream.Token;
13
14
internal
StreamEnumerable
(
15
BaseClient
client,
16
Stream
stream,
17
CancellationToken cancel =
default
)
18
{
19
_client = client;
20
_stream = stream;
21
_cancel = cancel;
22
}
23
24
public
async IAsyncEnumerator<Event<T>>
GetAsyncEnumerator
()
25
{
26
await
using
var subscribeStream = _client.SubscribeStream<T>(
27
_stream,
28
_client.MappingCtx,
29
_cancel);
30
31
while
(!_cancel.IsCancellationRequested && await subscribeStream.MoveNextAsync())
32
{
33
yield
return
subscribeStream.Current;
34
}
35
}
36
}
Fauna.BaseClient
The base class for Client and DataContext.
Definition
IClient.cs:371
Fauna.Core.StreamEnumerable
Definition
StreamEnumerable.cs:7
Fauna.Core.StreamEnumerable.Token
string Token
Definition
StreamEnumerable.cs:12
Fauna.Core.StreamEnumerable.GetAsyncEnumerator
async IAsyncEnumerator< Event< T > > GetAsyncEnumerator()
Definition
StreamEnumerable.cs:24
Fauna.Types.Stream
Represents a Fauna stream token.
Definition
Stream.cs:9
Fauna.Core
Definition
Connection.cs:10
Fauna.Types
Definition
BaseRef.cs:3
Fauna
Definition
Client.cs:10
Generated by
1.12.0