rails_event_store
rails_event_store copied to clipboard
Document how to achieve singleton event handler
There are situations when firing more instances of event handlers would be problematic. Show how one could achieve this (and there could be multiple ways to achieve it).
I am not sure I understand. Could you elaborate?
Once I did following stunt:
- there were domain events describing some fact in the system that carried geolocation in data
- I had a separate context that was interested in plotting that location on a map, more-or-less live
- for a reason I don't recall fully now it was beneficial to limit or even serialize event processing by that particular handler
What I meant was showing how one could achieve it, either via:
- sidekiq feature when you have sidekiq configured as an async event handler
- pessimistic lock with help of underlying database engine
Btw. this serialize event processing might be probably better suited to process managers documentation (we don't seem to have it?).