Skip to content

Releases: OoLunar/AsyncEvents

v2.1.0

Choose a tag to compare

@OoLunar OoLunar released this 24 Apr 06:15
6d98511

This release adds support for CancellationToken's, a required parameter to your async event handlers. This does not affect performance and is an additive only feature improvement.

v2.0.4

Choose a tag to compare

@OoLunar OoLunar released this 16 Jan 22:43
cb9b256

This release removes the use of lock and instead replaces it with ConcurrentDictionary and SemaphoreSlim's

v2.0.3

Choose a tag to compare

@OoLunar OoLunar released this 09 Jan 02:27
7709362

Fix stack traces when event handlers throw.

v2.0.2

Choose a tag to compare

@OoLunar OoLunar released this 08 Jan 21:26
8c90874

This release fixes the following exception:

System.InvalidOperationException: Sequence contains no elements.
   at OoLunar.AsyncEvents.AsyncEventClosures.AsyncEventMultiPreHandler`1.InvokeAsync(TAsyncEventArgs eventArgs)
   at OoLunar.AsyncEvents.AsyncEvent`1.InvokeAsync(TEventArgs eventArgs)

v2.0.1

Choose a tag to compare

@OoLunar OoLunar released this 07 Jan 07:55
83fefb8

This releases fixes AsyncEventContainer, ensuring GetAsyncEvent is thread safe.

v2.0.0

Choose a tag to compare

@OoLunar OoLunar released this 06 Jan 06:57
a250f3b

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.

v1.4.0

Choose a tag to compare

@OoLunar OoLunar released this 30 Dec 04:28
be7405b

This change removes the non-generic delegates due to incompatibility with the generic version of the same delegates. Please use the IAsyncEvent interface if you need to invoke the delegates without type safety checks.

v1.3.0

Choose a tag to compare

@OoLunar OoLunar released this 27 Dec 21:35
309544b

Introduces a new GetAsyncEvent(Type type) overload to AsyncEventContainer.

v1.2.0

Choose a tag to compare

@OoLunar OoLunar released this 27 Dec 03:43
7416717

This releases adds two new interfaces: IAsyncEvent and IAsyncEvent<in TEventArgs>.

IAsyncEvent

A non-generic version of IAsyncEvent<TEventArgs>. This interface is used to allow the invocation of an IAsyncEvent<TEventArgs> without knowing the type of the event arguments. The main purpose of this interface is to allow the invocation of an IAsyncEvent<TEventArgs> through a non-generic interface, which is useful when the type of the event arguments is not known at compile-time, but may be discovered at runtime through reflection or other similar means.

The event arguments passed to the methods of this interface will be casted to the type of the event arguments of the IAsyncEvent<TEventArgs> implementation. Please ensure that the event arguments passed to the methods of this interface are of the correct type.

IAsyncEvent<in TEventArgs>

This is meant to be an interface requested through DI as requesting the direct class is generally regarded as bad practice.

v1.1.1

Choose a tag to compare

@OoLunar OoLunar released this 27 Dec 03:42
eb04326

This release removes the 32 byte allocation for exceptionless invocations of pre and post handlers.