Open Snawoot opened 2 years ago
Hello @Snawoot and @millken it seems the PR is not merged. Any reason why?
@Tochemey Because only @asaskevich can merge.
Hello @asaskevich any reason this PR is not yet merged. Also do you advice to still use this library in production because I have not seen any update to it.?
@Tochemey Because only @asaskevich can merge.
Thank you so much @Snawoot
Fix #35 Fix #52
This PR does not holds lock during whole publish process. It saves from deadlocks when callbacks also trying to publish something or manage subscription on the bus.
Before this publish worked with copy of active handlers anyway, so now it's safe to work with bus because it uses locks only to manage internal state, not causing deadlock in subsequent calls from handlers.
There is a slight change in the handler object:
once
boolean flag replaced with pointer tosync.Once
. This achieves following goals:sync.Once
to be nullable and skip it when not needed.