EventHub | Library
Tech Stack :
This project is inspired by EventBus for Android & Java. you can checkout their repository at this link.
This is a project that implements the Pub/Sub model in a decoupled architecture. It can be especially useful in situations where entities have there own life-cycle.
This architecture can be used to develop applications for Xamarin.Forms, Xamarin.Android, Xamarin.iOS. It helps in seamless communication between various parts of the respective application models.
Features
- Attribute based API: Put the [EventSubscriber] attribute to your subscriber methods to mark it as a handler.
- Good performance: It is optimized to dispatch events as soon as they posted.
- Asynchronous event Delivery & Execution: All the event executions and delivery are asynchronous.
- Event & Subscriber inheritance: In EventHub, the object oriented paradigm apply to event and subscriber classes. Let's say event class A is the superclass of B. Posted events of type B will also be posted to subscribers interested in A. Similarly the inheritance of subscriber classes are considered.
- Main thread delivery: Using platform specific main thread invocation methods, you can also deliver UI changes to the application.
- No 3rd party dependency: This is no Xamarin binding, thus no 3rd party dependency or binding difficulties.
Add EventHub to your Project
✨ ✨ The first stable version of the project 🎉
Documentation
Click this link to check the README.md
Future Scope
- Build time subscriber method template cache, so that run time performance stays unaffected.
- Assign batches for every event posted.
- Cancellation will depend on execution state of the batch.
- Priority based event posting.