Laravel 5 Events and Queue -
as mentioned in laravel docs (http://laravel.com/docs/5.1/events#defining-listeners), can make listener queued. makes possible run events in asynchronous manner.
i went more deep this, , found out can have event fired in separate laravel installation, long use same queue instance(beanstalkd in case) , share same listener (the listener class should defined in both installations).
now need more information regarding this.
- is ok? mean, works now, considered "hack"? there library or way this?
- how can have distributed events using this? mean, when fire event somewhere, there listeners fired somewhere else. not on same installation, , of them has fired. not achievable current setup.
i think i'm looking distributed event system laravel, i'm not sure...
you don´t need queue achieve this. had similar problem , solve @ way:
- if want send events frontend on machine recommend use broadcasting events. can use redis or pusher.
- if want send events backend on machine need use redis sub/pub. send event place (publisher) , need in each machine listener event (subscribers).
i use beanstalkd distribute jobs in several instances. works charm!
Comments
Post a Comment