From 23970a4ac088a4e5e9e21abb2f0ae43663bb1bc9 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Tue, 2 Dec 2025 19:28:45 -0600 Subject: [PATCH] Update RELEASE_NOTES.md for 1.5.57-beta2 release --- Directory.Build.props | 59 ++++++++++++++++++++++++++++++++++++++----- RELEASE_NOTES.md | 59 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2276d8ed0df..a47e47d344a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ Copyright © 2013-$([System.DateTime]::Now.Year) Akka.NET Team Akka.NET Team - 1.5.56 + 1.5.57-beta2 akkalogo.png https://getakka.net/ Apache-2.0 @@ -50,15 +50,62 @@ true - Akka.NET v1.5.56 is a patch release containing important bug fixes for Akka.Remote and Akka.Streams. + Akka.NET v1.5.57-beta2 is a beta release containing significant new APIs for Akka.Persistence that add completion callbacks and async handler support. -**Bug Fixes:** +**New Features:** -* [Fix: Akka.Remote should not shutdown on invalid TLS traffic](https://github.com/akkadotnet/akka.net/pull/7952) - Fixes [issue #7938](https://github.com/akkadotnet/akka.net/issues/7938) where invalid traffic (like HTTP requests) hitting a TLS-enabled Akka.Remote port would cause the entire ActorSystem to shut down. Server now rejects invalid connections gracefully without terminating. +* [Persistence completion callbacks via Defer - simplified alternative](https://github.com/akkadotnet/akka.net/pull/7957) - This release adds completion callback and async handler support to `Persist`, `PersistAsync`, `PersistAll`, and `PersistAllAsync` methods in Akka.Persistence. Key improvements include: + - **Async Handler Support**: All persist methods now support `Func<TEvent, Task>` handlers for async event processing + - **Completion Callbacks**: `PersistAll` and `PersistAllAsync` now accept optional completion callbacks (both sync `Action` and async `Func<Task>`) that execute after all events are persisted and handled + - **Ordering Guarantees**: Completion callbacks use `Defer`/`DeferAsync` internally to maintain strict ordering guarantees + - **Zero Breaking Changes**: All new APIs are additive overloads -* [fix(streams): prevent race condition in ChannelSource on channel completion](https://github.com/akkadotnet/akka.net/pull/7951) - Fixes [issue #7940](https://github.com/akkadotnet/akka.net/issues/7940) where a `NullReferenceException` could occur when completing a `ChannelWriter` while the stream is waiting for data. Added atomic flag to prevent race condition between `OnReaderComplete` and `OnValueRead` callbacks. +**Code Examples:** -To see the full set of changes in Akka.NET v1.5.56, click here: https://github.com/akkadotnet/akka.net/milestone/139?closed=1 +```csharp +// Async handler support - process events asynchronously +Persist(new OrderPlaced(orderId), async evt => +{ + await _orderService.ProcessOrderAsync(evt); +}); + +// PersistAll with completion callback - know when all events are done +PersistAll(orderEvents, evt => +{ + _state.Apply(evt); +}, onComplete: () => +{ + // All events persisted and handlers executed + _logger.Info("Order batch completed"); + Sender.Tell(new BatchComplete()); +}); + +// PersistAll with async handler AND async completion callback +PersistAll(events, + handler: async evt => await ProcessEventAsync(evt), + onCompleteAsync: async () => + { + await NotifyCompletionAsync(); + Sender.Tell(Done.Instance); + }); + +// PersistAllAsync with completion - allows commands between handlers +PersistAllAsync(largeEventBatch, + handler: evt => _state.Apply(evt), + onComplete: () => Sender.Tell(new BatchProcessed())); +``` + +**Technical Details:** + +The implementation maintains Akka.Persistence's strict ordering guarantees by using `Defer`/`DeferAsync` for completion callbacks, ensuring they execute in order even when called with empty event collections. The new async handler invocations (`IAsyncHandlerInvocation`) are processed via `RunTask` to preserve the actor's single-threaded execution model. + +1 contributor since release 1.5.57-beta1 + +| COMMITS | LOC+ | LOC- | AUTHOR | +| --- | --- | --- | --- | +| 1 | 1386 | 67 | Aaron Stannard | + +To [see the full set of changes in Akka.NET v1.5.57-beta2, click here](https://github.com/akkadotnet/akka.net/milestone/141?closed=1) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4d0dfc6253f..a33a3970e6d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,62 @@ +#### 1.5.57-beta2 December 2nd, 2025 #### + +Akka.NET v1.5.57-beta2 is a beta release containing significant new APIs for Akka.Persistence that add completion callbacks and async handler support. + +**New Features:** + +* [Persistence completion callbacks via Defer - simplified alternative](https://github.com/akkadotnet/akka.net/pull/7957) - This release adds completion callback and async handler support to `Persist`, `PersistAsync`, `PersistAll`, and `PersistAllAsync` methods in Akka.Persistence. Key improvements include: + - **Async Handler Support**: All persist methods now support `Func` handlers for async event processing + - **Completion Callbacks**: `PersistAll` and `PersistAllAsync` now accept optional completion callbacks (both sync `Action` and async `Func`) that execute after all events are persisted and handled + - **Ordering Guarantees**: Completion callbacks use `Defer`/`DeferAsync` internally to maintain strict ordering guarantees + - **Zero Breaking Changes**: All new APIs are additive overloads + +**Code Examples:** + +```csharp +// Async handler support - process events asynchronously +Persist(new OrderPlaced(orderId), async evt => +{ + await _orderService.ProcessOrderAsync(evt); +}); + +// PersistAll with completion callback - know when all events are done +PersistAll(orderEvents, evt => +{ + _state.Apply(evt); +}, onComplete: () => +{ + // All events persisted and handlers executed + _logger.Info("Order batch completed"); + Sender.Tell(new BatchComplete()); +}); + +// PersistAll with async handler AND async completion callback +PersistAll(events, + handler: async evt => await ProcessEventAsync(evt), + onCompleteAsync: async () => + { + await NotifyCompletionAsync(); + Sender.Tell(Done.Instance); + }); + +// PersistAllAsync with completion - allows commands between handlers +PersistAllAsync(largeEventBatch, + handler: evt => _state.Apply(evt), + onComplete: () => Sender.Tell(new BatchProcessed())); +``` + +**Technical Details:** + +The implementation maintains Akka.Persistence's strict ordering guarantees by using `Defer`/`DeferAsync` for completion callbacks, ensuring they execute in order even when called with empty event collections. The new async handler invocations (`IAsyncHandlerInvocation`) are processed via `RunTask` to preserve the actor's single-threaded execution model. + +1 contributor since release 1.5.57-beta1 + +| COMMITS | LOC+ | LOC- | AUTHOR | +| --- | --- | --- | --- | +| 1 | 1386 | 67 | Aaron Stannard | + +To [see the full set of changes in Akka.NET v1.5.57-beta2, click here](https://github.com/akkadotnet/akka.net/milestone/141?closed=1) + #### 1.5.57-beta1 December 2nd, 2025 #### Akka.NET v1.5.57-beta1 is a beta release containing a significant new feature for structured/semantic logging.