swoole-src
swoole-src copied to clipboard
Best way to call Websocket server methods from other parts of application?
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?
Hi, You can take a look for this repo https://github.com/Gemini-D/chat-api
But I change to nsq from rabbitmq.
https://github.com/gzydong/hyperf-chat
This repo use rabbitmq.