EventWeave 0.4.1
dotnet add package EventWeave --version 0.4.1
NuGet\Install-Package EventWeave -Version 0.4.1
<PackageReference Include="EventWeave" Version="0.4.1" />
<PackageVersion Include="EventWeave" Version="0.4.1" />
<PackageReference Include="EventWeave" />
paket add EventWeave --version 0.4.1
#r "nuget: EventWeave, 0.4.1"
#:package EventWeave@0.4.1
#addin nuget:?package=EventWeave&version=0.4.1
#tool nuget:?package=EventWeave&version=0.4.1
EventWeave
Lightweight event aggregation for .NET. Zero dependencies. Decoupled pub/sub messaging between services.
Why
When services need to communicate without knowing about each other, you need a message bus. EventWeave provides a minimal IEventAggregator that handles subscription, publication, and cleanup — with weak references to prevent memory leaks.
No frameworks. No reflection. No magic. Just pub/sub.
Install
dotnet add package EventWeave
dotnet add package EventWeave.CommunityToolkit
Install into Unity
In Package Manager add the following git url:
https://github.com/olivegamestudio/EventWeave.git?path=/upm
Quick start
Define a message as a record:
public sealed record OrderPlacedMessage(int OrderId, decimal Total);
Subscribe:
public sealed class NotificationService
{
public NotificationService(IEventAggregator events)
{
events.Subscribe<OrderPlacedMessage>(this, OnOrderPlaced);
}
void OnOrderPlaced(OrderPlacedMessage message)
{
// send notification
}
}
Publish:
public sealed class OrderService
{
readonly IEventAggregator _events;
public OrderService(IEventAggregator events)
{
_events = events;
}
public void PlaceOrder(int orderId, decimal total)
{
// process order
_events.Publish(new OrderPlacedMessage(orderId, total));
}
}
Unsubscribe when done:
events.Unsubscribe(this);
Setup
Standalone (no DI)
IEventAggregator events = new EventAggregator();
Microsoft DI
services.AddSingleton<IEventAggregator, EventAggregator>();
CommunityToolkit.Mvvm adapter
If you already use IMessenger in your presentation layer and want EventWeave in your application layer:
dotnet add package EventWeave.CommunityToolkit
services.AddSingleton<IMessenger, WeakReferenceMessenger>();
services.AddSingleton<IEventAggregator, MessengerEventAggregator>();
Diagnostics
Publish automatically captures caller information for debugging:
public interface IEventAggregator
{
void Publish<TMessage>(
TMessage message,
[CallerMemberName] string? caller = null,
[CallerFilePath] string? file = null)
where TMessage : class;
}
Packages
| Package | Purpose |
|---|---|
EventWeave |
Core library. IEventAggregator, EventAggregator. Zero dependencies, netstandard2.0. |
EventWeave.CommunityToolkit |
Adapter MessengerEventAggregator wrapping IMessenger from CommunityToolkit.Mvvm. |
Design principles
- Zero dependencies in the core package. Runs on .NET Framework 4.6.2, .NET 10, Unity, MonoGame — anywhere netstandard2.0 works.
- Thread safe. Subscriptions and publications are safe to call from any thread.
- No reflection. All wiring is explicit or source-generated.
- Messages are records. Immutable, equatable, pattern-matchable.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- MissingAttributes (>= 1.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EventWeave:
| Package | Downloads |
|---|---|
|
EventWeave.CommunityToolkit
EventWeave adapter for CommunityToolkit.Mvvm IMessenger. Bridges EventWeave with existing MVVM messaging infrastructure. |
GitHub repositories
This package is not used by any popular GitHub repositories.