Skip to content

Drop .NET Standard 1.3 and rework AsyncEvents

Mateusz Brawański requested to merge feature/emzi-asyncevent into master

Summary

This PR drops support for .NET Standard 1.3, per previous poll. In addition to it, it also reworks AsyncEvents.

Details

.NET Standard 1.3 target is no more. The library targets .NET Standard 2.0 exclusively now. This means that .NETFX version requirements are >=4.6.1 now (as opposed to 4.6 previously). Do note that FX is not explicitly supported; you should be using .NET Core.

The AsyncEvent implementation in the library has been replaced with one from Emzi0767.Common. The new implementation is far more flexible, robust, and comes with more features. Event handlers all now take 2 arguments, instead of 1: a sender argument was added as a first argument (the second argument is the prior sole argument). With this change, comes removal of Client from most EventArgs instances. The instance is now provided, either directly or indirectly, via sender argument of event handlers now.

Changes proposed

  • Drop .NET Standard 1.3 target.
    • This bumps .NETFX req to 4.6.1.
    • This allows us to evolve better.
  • Use AsyncEvent from Emzi0767.Common.
    • Event handlers now take 2 arguments: sender and args.
      • First one is the sending instance (typically client or the extension which generated the event).
      • Second one is the arguments to the event.
    • Client property is now removed from most EventArgs instances. See above on how to get the client instance.
    • Events now have a timeout. The timeout is soft, when it expires, an error log will be emitted to the configured logger.
    • Event errors are more detailed, exceptions are unwrapped, and the method which caused the exception is now listed in the error log message.

Notes

Yes I am farming.

Merge request reports

Loading