-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding sensible persistent subscriptions
- Loading branch information
1 parent
10f86d3
commit 874f978
Showing
99 changed files
with
4,798 additions
and
1,903 deletions.
There are no files selected for viewing
321 changes: 304 additions & 17 deletions
321
...EventStore.Client.PersistentSubscriptions/EventStorePersistentSubscriptionsClient.Read.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/EventStore.Client.PersistentSubscriptions/PersistentSubscriptionMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
namespace EventStore.Client { | ||
/// <summary> | ||
/// The base record of all stream messages. | ||
/// </summary> | ||
public abstract record PersistentSubscriptionMessage { | ||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> that represents a <see cref="EventStore.Client.ResolvedEvent"/>. | ||
/// </summary> | ||
/// <param name="ResolvedEvent">The <see cref="EventStore.Client.ResolvedEvent"/>.</param> | ||
/// <param name="RetryCount">The number of times the <see cref="EventStore.Client.ResolvedEvent"/> has been retried.</param> | ||
public record Event(ResolvedEvent ResolvedEvent, int? RetryCount) : PersistentSubscriptionMessage; | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> representing a stream that was not found. | ||
/// </summary> | ||
public record NotFound : PersistentSubscriptionMessage { | ||
internal static readonly NotFound Instance = new(); | ||
} | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> representing a successful read operation. | ||
/// </summary> | ||
public record Ok : PersistentSubscriptionMessage { | ||
internal static readonly Ok Instance = new(); | ||
}; | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> indicating the first position of a stream. | ||
/// </summary> | ||
/// <param name="StreamPosition">The <see cref="EventStore.Client.StreamPosition"/>.</param> | ||
public record FirstStreamPosition(StreamPosition StreamPosition) : PersistentSubscriptionMessage; | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> indicating the last position of a stream. | ||
/// </summary> | ||
/// <param name="StreamPosition">The <see cref="EventStore.Client.StreamPosition"/>.</param> | ||
public record LastStreamPosition(StreamPosition StreamPosition) : PersistentSubscriptionMessage; | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> indicating the last position of the $all stream. | ||
/// </summary> | ||
/// <param name="Position">The <see cref="EventStore.Client.Position"/>.</param> | ||
public record LastAllStreamPosition(Position Position) : PersistentSubscriptionMessage; | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> indicating that the subscription is ready to send additional messages. | ||
/// </summary> | ||
/// <param name="SubscriptionId">The unique identifier of the subscription.</param> | ||
public record SubscriptionConfirmation(string SubscriptionId) : PersistentSubscriptionMessage; | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> indicating that a checkpoint has been reached. | ||
/// </summary> | ||
/// <param name="Position">The <see cref="Position" />.</param> | ||
public record AllStreamCheckpointReached(Position Position) : PersistentSubscriptionMessage; | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> indicating that a checkpoint has been reached. | ||
/// </summary> | ||
/// <param name="StreamPosition">The <see cref="StreamPosition" />.</param> | ||
public record StreamCheckpointReached(StreamPosition StreamPosition) : PersistentSubscriptionMessage; | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> indicating that the subscription is live. | ||
/// </summary> | ||
public record CaughtUp : PersistentSubscriptionMessage { | ||
internal static readonly CaughtUp Instance = new(); | ||
} | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> indicating that the subscription has switched to catch up mode. | ||
/// </summary> | ||
public record FellBehind : PersistentSubscriptionMessage { | ||
internal static readonly FellBehind Instance = new(); | ||
} | ||
|
||
/// <summary> | ||
/// A <see cref="PersistentSubscriptionMessage"/> that could not be identified, usually indicating a lower client compatibility level than the server supports. | ||
/// </summary> | ||
public record Unknown : PersistentSubscriptionMessage { | ||
internal static readonly Unknown Instance = new(); | ||
} | ||
} | ||
} |
Oops, something went wrong.