[LRUG] Event Bus in ruby

Graham Ashton graham at effectif.com
Wed Aug 20 06:12:30 PDT 2014


On Wednesday 20 August, Stephen Best wrote:

> > The only problem I have is that EventBus is meant to be used in a static
> > fasion which makes unit testing a bit harder, but not impossible...

> I probably wouldn't use it for exactly that reason.

I wrote a reply this morning, but it doesn't seem to have made it to the
list. Hopefully I'm not repeating myself...

I use a small Ruby module that I mix in to code that I want to be able
to "publish" an event. I setup my subscribers manually at run time (e.g.
within a controller action) and find it works really well.

Search this page for "Publisher" and you'll find it. It's really simple,
and is easy to work with.

https://www.agileplannerapp.com/blog/building-agile-planner/refactoring-with-hexagonal-rails



More information about the Chat mailing list