Repository navigation
v2.0.0
AsyncEventContainer/AsyncEvent
All modifications to pre/post handlers are now thread safe to prevent the following error message:
System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
IAsyncEvent(<T>)
These two interfaces now contain default implementations, though inheriting from AsyncEvent<T> is still recommended.
AsyncEvent<T>
The AsyncEvent<T> class has been split up. Previously there were three constructors, two of which enabled parallelization behavior that was disabled by default. That behavior has now been moved into the ParallelAsyncEvent<T> class, which may be desired when registering/executing multiple long-running event handlers.
DebugAsyncEvent<T>
This class is very helpful for debugging why specific handlers are not executing. While generally very helpful to use during development, there is a significant performance impact when doing so (+120% in base execution time, 704 + (64 * handlerCount) bytes in memory usage).
ParallelAsyncEvent<T>
Helpful when executing several long running event handlers, this async event type only executes handlers in parallel when the total amount of registered pre/post handlers (exclusive) exceeds MinimumParallelHandlerCount, which is specified only in the constructor. By default, MinimumParallelHandlerCount is set to Environment.ProcessorCount, however it can be overridden. The event handlers are grouped together by priority and executed in batches to ensure behavior relying on another event handler's priority is preserved.
Benchmarks/Tests
Benchmarking and testing have been completely rewritten from scratch, now executing the same logic for different async event types. This ensures consistent behavior and allows for easier spotting of regressions. Unfortunately there are now 402 total benchmarks, so it's recommended to filter out the benchmarks you're not interested in seeing reports for.