Repository navigation
·
3 commits
to release-3.0
since this release
Radical 3.0.0 makes the message broker async-only, and removes the members that 2.1.0 marked obsolete.
The package still targets netstandard2.0. It's built and tested against .NET 10 only.
Radical.Windows 4.0.0 and Radical.Avalonia 1.0.0 are built on this release.
Breaking changes
The message broker is async-only
Subscribers, standalone handlers and publishers all use Task-based APIs (#749, #750). Follow the upgrade guide, which also describes the changes in WPF and Avalonia applications.
| Radical 2.x | Radical 3.0 |
|---|---|
Subscribe<T>(subscriber, Action<object, T> callback), and the other overloads taking an Action |
Subscribe<T>(subscriber, Func<object, T, Task> callback), and the matching overloads |
Dispatch(sender, message) |
await DispatchAsync(sender, message) |
Broadcast(sender, message) |
await BroadcastAsync(sender, message), or a deliberate fire-and-forget _ = BroadcastAsync(sender, message) |
IHandleMessage<T>.Handle and AbstractMessageHandler<T>.Handle |
HandleAsync, returning a Task |
DispatchAsyncinvokes the subscribers one at a time, on the publisher's context, asDispatchdid.BroadcastAsyncinvokes them in parallel, on thread pool threads, asBroadcastdid. The documentation explains when to use which.- Callback filters,
ShouldHandle,Unsubscribeand the invocation models are unchanged. Dispatch,Broadcastand theSubscribeoverloads taking anActionare obsolete with an error, so the compiler reports error CS0619 with a link to the upgrade guide. If reached at runtime, through reflection for example, they throw aNotSupportedException.- Classes inheriting from
AbstractMessageHandler<T>, or implementingIHandleMessage<T>orIMessageBroker, fail with standard compiler errors (CS0534, CS0506 or CS0535) until they implementHandleAsyncorDispatchAsync.
The obsolete members are removed in 4.0.0: #752, #753, #754, #755, #756.
Removed members that 2.1.0 marked obsolete
- The Puzzle container:
IPuzzleContainer,IPuzzleContainerEntry,IPuzzleContainerFacility,IPuzzleSetupDescriptor,IContainerEntry,IBootable,LifestyleandComponentRegisteredEventArgs(#433). UseMicrosoft.Extensions.DependencyInjection. - The factories in
Radical.ComponentModel.FactoriesandRadical.Model.Factories:IEntityFactory,IChangeTrackingServiceFactoryandChangeTrackingServiceFactory. IRequireValidationCallback<T>, and theRadical.ComponentModel.Validationnamespace with it.- The
CommandLineandPasswordhelpers inRadical.Helpers.
Removed and changed members without an obsolete release
These weren't marked obsolete in a released 2.x version:
CastExtensions, with theAs<TResult>andCastTo<TResult>extension methods (#315). Use pattern matching, such asif (obj is TResult result), instead.EntityCollection<T>.OnInitialize()(#437).- The
AnalyticsEvent.Datasetter:Datais read-only (#431). RandomStrings.MinLenghtandMaxLenght, misspelled, are renamed toMinLengthandMaxLength(#426).
Other changes
EntityItemViewValueGetterArgs<T, TValue>becomesEntityItemViewValueGetterArgs<T>:TValuewas never used (#435, #746).RandomStringsthrows anInvalidOperationExceptionwhen its constraints can't be satisfied, for example a requested length larger than the available characters withAllowRepeatCharactersdisabled, instead of looping forever (#598).LimitedConcurrencyLevelTaskScheduler.MaximumConcurrencyLevelis sealed.
Full changelog: 2.1.0...3.0.0