diff --git a/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs b/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs index f31d0ad..dcb413a 100644 --- a/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs +++ b/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductTotalsActor.cs @@ -49,8 +49,6 @@ public ProductTotalsActor(string persistenceId) var response = State.ProcessCommand(cmd); var sentResponse = false; - var sender = Sender; - if (response.ResponseEvents.Any()) { PersistAll(response.ResponseEvents, productEvent => @@ -66,7 +64,15 @@ public ProductTotalsActor(string persistenceId) if (!sentResponse) // otherwise we'll generate a response-per-event { sentResponse = true; - sender.Tell(response); + + async Task ReplyToSender() + { + await Task.Delay(1); + return response; + } + + ReplyToSender().PipeTo(Sender, failure: ex => new Status.Failure(ex)); + } if(LastSequenceNr % 10 == 0)