Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WeakReference + CWT EventManager refactoring #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vasmann
Copy link

@vasmann vasmann commented Sep 15, 2023

  • changed concept: all global contexts share same EventManager
  • EventManager supports WeakReferences + ConditionalWeakTable (CWT)
  • EventManager supports AOT generic event handlers which to increase performance. You can still use events without AOT which will produce overhead during event execution + possible boxing for value type events
  • EventManager supports ValueType events (consider using AOT through DeclareEvent call to avoid boxing and performance hit)
  • EventManager supports event inheritance and filtering. Please note, you can not handle ValueType events with void Handle(object @event) handlers. ValueTypes handlers are invariant
  • removed commands concept
  • refactored context: renamed methods to more apropriate

Vasily Moiseev and others added 3 commits September 15, 2023 17:03
- changed concept: all global contexts share same EventManager
- EventManager supports WeakReferences + ConditionalWeakTable (CWT)
- EventManager supports AOT generic event handlers which to increase performance. You can still use events without AOT which will produce overhead during event execution + possible boxing for value type events
- EventManager supports ValueType events (consider using AOT through DeclareEvent call to avoid boxing and performance hit)
- EventManager supports event inheritance and filtering. Please note, you can not handle ValueType events with void Handle(object @event) handlers. ValueTypes handlers are invariant
- removed commands concept
- refactored context: renamed methods to more apropriate
*
- now you can trigger event like manager.DispatchEvent<Base>(new Derived()) or manager.DispatchEvent<object>(new SomeStruct()) - so if Derived, SomeStruct events were declared they will be called by fast branch.
- manager.DispatchEvent<object>(new SomeStruct()) - SomeStruct will be unboxed once and all handlers will receive unboxed value
*
- added fix to intercept events if interceptor is registered after derived events were declared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant