parth-vora-7 / Laravel-Realtime-Chat

Real time group & private chat using Laravel brodcasting, Laravel Echo, Socket.io and Redis
http://52.66.22.29/lara_chat/public
48 stars 37 forks source link

Problem with sync messages. #4

Open ntnhieu opened 6 years ago

ntnhieu commented 6 years ago

Hi, My example run very well, but the message between persons in different browser it's not synchonize. Example in browser A sent message but in browser B didn't show this message just sent. But when I'm typing still show "person's typing". Can u have me about this?

solancer commented 6 years ago

I have the same exact same issue, any possible fix?

parth-vora-7 commented 6 years ago

@ntnhieu @solancer Are you guys able to see any javascript errors in the browser console? Also when you submit a message, are you able to see an event occurring on the console running command laravel-echo-server start

Most probably it should be a missing or wrong configuration issue.

Thanks

solancer commented 6 years ago

I was able to fix it by changing QUEUE_DRIVER=sync in the .env file. I've sent a pull request to save you some time on updating the readme file.

parth-vora-7 commented 6 years ago

Hey guys,

Glad you could make it working. But the setting queue driver to redis was intentionally as in real life scenarios it would help a lot in terms of performance.

https://laravel.com/docs/5.5/events#queued-event-listeners

So if you want to use queue, you just need to set queue driver to redis and need to keep running queue listener command php artisan queue:wok in the background. I would suggest you to use supervisor for that:

https://laravel.com/docs/5.5/queues#supervisor-configuration

Will add both ways into readme file i.e using queue and without using queue.

Thanks On 3 Dec 2017 5:00 a.m., "Srinivas Gowda" notifications@github.com wrote:

I was able to fix it by changing QUEUE_DRIVER=sync in the .env file. I've sent a pull request to save you some time on updating the readme file.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/xparthxvorax/Laravel-Realtime-Chat/issues/4#issuecomment-348728139, or mute the thread https://github.com/notifications/unsubscribe-auth/AEC5u_Jml-i_EyzZjpz_ybwjy1rM29_wks5s8d2dgaJpZM4PFlTn .