You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello world!
I made coroutine-based WebSocket server https://wiki.swoole.com/en/#/coroutine/ws_server And now i want create a notification service. While websocket server has any connected clients it check some data in DB and than send that info to clients. But if i add some like that:
while (!!$wsObjects) {
sleep(1);
$ws->push(json_encode($stmt->fetchAll()));
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello world!
I made coroutine-based WebSocket server https://wiki.swoole.com/en/#/coroutine/ws_server And now i want create a notification service. While websocket server has any connected clients it check some data in DB and than send that info to clients. But if i add some like that:
loop stay infinite and i can`t close any connections https://wiki.swoole.com/en/#/getting_started/notice?id=the-impact-of-while-loop
How can i made notification service with swoole websocket coroutine notification server?
Beta Was this translation helpful? Give feedback.
All reactions