-
Notifications
You must be signed in to change notification settings - Fork 0
Abstraction layer
While being an extremely small library, Kawa is designed to provide full control over the way it works.
To achieve this, a complete abstraction layer composed of a few interfaces is described here.
A Subscription
is an object able to consume a given event instance.
In addition to the method that consumes an event, a priority
along with a topic
are required to simplify manipulation by buses.
Although this object seems fairly easy to implement, most of the performances optimizations come from it: compilation/JIT inlining, ASM, ... are among all those features that result in major performance results, at either instantiation or invocation.
A Listener
is an object that associates event topics to a Subscription
set. Supposed to only be for registration purposes, they can be seen as "subscription holders" and are not to be stored by buses.
Once again, many ways of representing listeners are possible : classes, instantiated by builders, ...
A Bus
is an object used to publish events and allow subscriptions to consume them, meaning they're the core of the whole library.
An implementation example can be found as the OptimizedBus.java (optimized-bus) class.