log event seqNo and timestamp. Fix synchronization

pull/4/head
Zlatin Balevsky 2018-07-23 01:08:08 +01:00
parent ffa659b030
commit e860ee1e20
1 changed files with 2 additions and 2 deletions

View File

@ -11,10 +11,10 @@ class EventBus {
private Map handlers = new HashMap()
void publish(Event e) {
log.fine "publishing event of type ${e.getClass().getSimpleName()}"
log.fine "publishing event of type ${e.getClass().getSimpleName()} seqNo ${e.seqNo} timestamp ${e.timestamp}"
def currentHandlers
final def clazz = e.getClass()
synchronized(handlers) {
synchronized(this) {
currentHandlers = handlers.getOrDefault(clazz, [])
}
currentHandlers.each {