13 internal string Token {
get; }
33 var writer =
new Utf8JsonWriter(stream);
34 writer.WriteStartObject();
35 writer.WriteString(
"token", Token);
36 if (Options.
Cursor !=
null)
38 writer.WriteString(
"cursor", Options.
Cursor);
40 else if (Options.
StartTs !=
null)
42 writer.WriteNumber(
"start_ts", Options.
StartTs.Value);
47 writer.WriteNumber(
"page_size", Options.
PageSize.Value);
50 writer.WriteEndObject();
62 if (ReferenceEquals(
null, other))
return false;
63 if (ReferenceEquals(
this, other))
return true;
64 return Token == other.Token;
72 public override bool Equals(
object? obj)
74 if (ReferenceEquals(
null, obj))
return false;
75 if (ReferenceEquals(
this, obj))
return true;
76 if (obj.GetType() != GetType())
return false;
86 return Token.GetHashCode();
99 public string?
Cursor {
get;
internal set; }
Represents the options for a Fauna EventSource.
string? Cursor
Cursor returned from Fauna.
long? StartTs
Start timestamp returned for the feed. Used to resume the Feed.
int? PageSize
Limit page size for the Feed.
Represents a Fauna EventSource for initializing Streams and Feeds.
override int GetHashCode()
The default hash function.
EventSource(string token)
Initializes an EventSource.
void Serialize(Stream stream)
Serializes the event source to the provided Stream.
override bool Equals(object? obj)
Determines whether the specified object is equal to the current Stream.
bool Equals(EventSource? other)
Determines whether the specified Stream is equal to the current Stream.