Fellow devs, do you use event/listener pattern often?
Discussion
I used to when I wrote UI for content management systems, but for stuff i work on now, generally not. As with all things, it depends.
I don't think in terms of formalisms, I think in terms of how to solve my problem. I use channels to send messages, where the recipient might be just one or possibly many listeners, but rarely. For example, I have one-thread-per-relay, and the overlord sends a 'shutdown' message to all of them. I'm not sure if that is the "event/listener" pattern.
I use even driven architectures a lot in distributed systems. the main properties I select this for is resiliency and ability to scale. it’s resilient because it allows multiple producers and consumers, if one process dies it’s ok. it’s scalable because each component can be independently scaled up or down based on demand. AMA
I've used it before in microservices. It honestly becomes really hard to track all that would be happening and we'd ended up rewriting that service without it. I think using it between systems would work significantly better.
Yes, espaclly the "observer pattern" to handle extarnel incoming events. Like a status change from a user interface to inform all observer, which are registering there self on the observed subject.