swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

Best way to call Websocket server methods from other parts of application?

Open julia-fix opened this issue 4 years ago • 2 comments

Currently I'm trying to integrate Swoole websocket server to existing chat application for the purpose of sending notifications to online users. Can't find examples of calling Swoole\WebSocket\Server->push from php files other than one that starts the server. It is advised here https://stackoverflow.com/questions/49226659/swoole-with-rabbitmq to establish a server-side websocket connection to Swoole server to inform it about new event via a regular websocket message. Is it the only way to achieve websocket server from other server functions?

julia-fix avatar Apr 20 '21 11:04 julia-fix

Hi, You can take a look for this repo https://github.com/Gemini-D/chat-api

But I change to nsq from rabbitmq.

limingxinleo avatar Apr 27 '21 11:04 limingxinleo

https://github.com/gzydong/hyperf-chat

This repo use rabbitmq.

limingxinleo avatar Apr 27 '21 11:04 limingxinleo