laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
942 stars 63 forks source link

Can we have a bidirectional connection with reverb?? from client to server and from server to client?? #199

Closed muhammedjafer closed 2 months ago

joedixon commented 2 months ago

Hey @muhammedjafer technically yes if Reverb is running alongside your application (not on a separate server). You can hook into the MessageReceived event. You should be aware that any action you carry out here will block other connections and messages from being processed, so you should ensure you are not carrying out any resource intensive actions.

muhammedjafer commented 2 months ago

@joedixon , why it would be blocking, or why where the code runs would matter????

joedixon commented 2 months ago

@muhammedjafer if you don't have Reverb running in your application and, instead, run it on a separate server, you have no way to hook into the events fired by Reverb in the context of your application.

Hooking into the event would be a syncronous process and so would block Reverb's ReactPHP powered event loop.

muhammedjafer commented 1 month ago

@joedixon , thanks but I find it weird to not have documentation about client side event to the server and not between clients as it is one of the key features of websocket since server side events can be implemented without it. i hope laravel adds that as a separate section in laravel reverb documentation