Skip to content

2.2.1

Choose a tag to compare

@Adiakys Adiakys released this 01 Nov 15:02
· 9 commits to main since this release
162212a

Faster Publish

With the default sequential strategy, Publish now awaits handlers directly instead of building a delegate per handler, resolves its sinks once per IPublisher instance, and uses the built-in notification publishers as singletons (they hold no state; a custom publisher keeps cfg.Lifetime).

2.2.0 2.2.1 MediatR 12.5
Publish, 1 handler 196 ns, 344 B 90 ns, 80 B 145 ns, 288 B
Publish, 3 handlers 302 ns, 632 B 151 ns, 144 B
Send 97 ns, 96 B 86 ns, 96 B 92 ns, 200 B

Other strategies, tracing and handlers for base types behave as before. Details on the performance page.

Fixed

  • Generic handlers are disposed. Open generic handlers (AuditHandler<T> : INotificationHandler<EntityCreated<T>>) are now created by the container, so one that implements IDisposable or IAsyncDisposable is disposed when its scope ends, like any other handler. Previously it was never disposed.

No API changes.

Full changelog: 2.2.0...2.2.1