-
Notifications
You must be signed in to change notification settings - Fork 146
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
Some suggestions abount BusConfiguration and @Handler. #46
Comments
Hi bobwenx, if you want a synchronous environment only, it's actually worse than you think: However, most of that doesn't matter all that much if you use the synchronous dispatch only. (i.e. Also, you may want to consider splitting this into three separate issues, so bennidi can address them all separately. |
Also, you pasted this method call:
You may want to remove that, if you subclassed |
hi, durron597: eventBusConfig.setMetadataReader(new SubscribeConfigChangedMedataReader()); has only purpose for process custome annotation, as i suggestion in above. for BusConfiguration class, i think there may have different factory method for various environment, for example: public static BusConfiguration Default() {
BusConfiguration defaultConfig = new BusConfiguration();
// initialize default value for both sync & async environment.
return defaultConfig;
} Or public static BusConfiguration SyncConfiguration() {
BusConfiguration defaultConfig = new BusConfiguration();
// initialize default value for sync environment only.
return defaultConfig;
} |
Hey, just a short update. I am almost done integrating part of your suggestions. This will contain a restructuring of the BusConfiguration using an additional interface and adding thread factories such that the asynchronous parts can be customized. I will also add factory methods for different scenarios (sync[guaranteed sequential processing], async). I restructured some of the code internally and fixed the dead message bug #44. I did not really understand the benefit of the custom handler annotation, though... |
Hey, just another note: I changed the way how a MessageHandler is constructed such that it is now easily possible to provide necessary handler information from different sources (annotations) than the standard mbassador way of doing things. I also added a factory for bus instances which I plan to extend with different scenarios and bus types. Currently it contains a scenario where asynchronously dispatched messages are guaranteed to be processed in their order of dispatch. I hope that makes you happy. Cheers! |
#1:
net.engio.mbassy.bus.BusConfiguration has only one default constructor:
so, when i construct it and i want to set it's executor to another executor, i have to first get the default one and shutdown it. the code is tedious:
may be it need more suitable design, for example: move the code in constructor to Default() method:
#2:
the test case: src\test\java\org\mbassy\ConcurrentSetTest.java has a method called testIteratorCleanup():
in my machine(windows 8 x64 + jdk 1.7_10), this test case will fail due to GC threads is running slowly. i have to add some time-pause to get around it.
#3
i think it may be a good idea to add Custome annotation that can subscribe the event. for example, change @handle's defination, let it can annotate to another Custome annotation that can subscribe event:
then, i can define my custome event handle annotation:
The text was updated successfully, but these errors were encountered: