As mentioned in Laravel docs (http://laravel.com/docs/5.1/events#defining-listeners), I can make a listener to be queued. This makes it possible to run events in an asynchronous manner.
I went more deep into this, and found out that I can even have the event to be fired in a separate Laravel installation, as long as they use the same queue instance(beanstalkd in my case) and they also share the same listener (the listener class should be defined in both installations).
Now I need some more information regarding this.
- Is this OK? I mean, it works for now, but is it considered a "hack"? Is there any library or another way for this?
- How can I have distributed events using this? I mean, when I fire an event somewhere, there will be some listeners that will be fired somewhere else. They are not on the same installation, and all of them has to be fired. This is not achievable with my current setup.
I think I'm looking for some distributed event system with Laravel, but I'm not sure...