[SCB-360] write simpler eventBus to optimize performance#570
Conversation
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.code.findbugs</groupId> | ||
| <artifactId>jsr305</artifactId> |
There was a problem hiding this comment.
why add this dependency? Can not find it's usage from code below
There was a problem hiding this comment.
my first impl extend EventSubscriber to write a new Subscriber, if not add the dependency, will cause class not found exception
but impl changed at last, i will if need it too.
There was a problem hiding this comment.
no need this anymore, delete it.
| } | ||
|
|
||
| @Override | ||
| public void post(Object event) { |
There was a problem hiding this comment.
This implementation will block event senders if subscribers processed not very fast.
It's better to mention this in the class description.
There was a problem hiding this comment.
registrer and unregister will not block post
There was a problem hiding this comment.
post action follow guava definition, just make it simpler(see comments in class level)
There was a problem hiding this comment.
OK. This will just make events out of order when trigger events in events handling logic.
| // different between this class and EventBus: | ||
| // 1. not support cycle trigger: | ||
| // subscribe a, when handle a, trigger event b | ||
| // subscribe b, when handle b, trigger event a |
There was a problem hiding this comment.
It's better to make this comments as Java Docs in EventManager in case user miss use it.
There was a problem hiding this comment.
changed to javadoc in SimpleEventBus
but not in EventManager
IDE compile warnings check:
