From 9d41ba7b61d8a925964e50dde42b6f5d644941c1 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Fri, 24 May 2024 14:57:04 -0500 Subject: [PATCH] added DocFx annotations Going to incorporate this sample into the new Akka.NET documentation website --- .../SqlSharding.Host/Actors/ProductTotalsActor.cs | 4 +++- .../SqlSharding.Shared/ProductState.cs | 4 +++- .../SqlSharding.Sql.Host/Actors/ProductTotalsActor.cs | 11 ++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs b/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs index 5bd6c28..afb9a5b 100644 --- a/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs +++ b/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs @@ -88,7 +88,9 @@ async Task ReplyToSender() Command(success => { - + // purge older snapshots and messages + DeleteSnapshots(new SnapshotSelectionCriteria(success.Metadata.SequenceNr - 1)); + //DeleteMessages(success.Metadata.SequenceNr); }); Command(fetch => diff --git a/src/clustering/sharding-sqlserver/SqlSharding.Shared/ProductState.cs b/src/clustering/sharding-sqlserver/SqlSharding.Shared/ProductState.cs index fee9f03..5e6b38d 100644 --- a/src/clustering/sharding-sqlserver/SqlSharding.Shared/ProductState.cs +++ b/src/clustering/sharding-sqlserver/SqlSharding.Shared/ProductState.cs @@ -179,6 +179,7 @@ public static ProductState ProcessEvent(this ProductState productState, IProduct } } +// /// /// The state object responsible for all event and message processing /// @@ -200,4 +201,5 @@ public record ProductState : IWithProductId public ImmutableSortedSet InventoryChanges { get; init; } = ImmutableSortedSet.Empty; public bool IsEmpty => Data == ProductData.Empty; -} \ No newline at end of file +} +// \ No newline at end of file diff --git a/src/clustering/sharding-sqlserver/SqlSharding.Sql.Host/Actors/ProductTotalsActor.cs b/src/clustering/sharding-sqlserver/SqlSharding.Sql.Host/Actors/ProductTotalsActor.cs index f31d0ad..679f5eb 100644 --- a/src/clustering/sharding-sqlserver/SqlSharding.Sql.Host/Actors/ProductTotalsActor.cs +++ b/src/clustering/sharding-sqlserver/SqlSharding.Sql.Host/Actors/ProductTotalsActor.cs @@ -23,8 +23,10 @@ public static Props GetProps(string persistenceId) /// Used to help differentiate what type of entity this is inside Akka.Persistence's database /// public const string TotalsEntityNameConstant = "totals"; - private readonly ILoggingAdapter _log = Context.GetLogger(); + public override string PersistenceId { get; } + // + public ProductState State { get; set; } public ProductTotalsActor(string persistenceId) { @@ -38,6 +40,9 @@ public ProductTotalsActor(string persistenceId) State = state; } }); + + // rest of message processing + // Recover(productEvent => { @@ -96,8 +101,4 @@ public ProductTotalsActor(string persistenceId) } }); } - - public override string PersistenceId { get; } - - public ProductState State { get; set; } } \ No newline at end of file