I want to use swoole to make a Message notification, such as a comment that has not been read, a private message... like the official website. On the top of the page, I suggest you have a few demands that have not accepted the answer. Then I read swoole. You can use the latest WebSocket feature of html5. it is simple, that is, considering WebSock... to use swoole for a Message notification, such as unread comments and private messages...
Like on the official website, you are prompted at the top of the page that you have a few demands that have not accepted the answer.
Then I read swoole. We can use the latest WebSocket feature of html5 to do this. It is simple to consider that WebSocket does not support ie browsers. I don't know if there is a better way to achieve compatibility using swoole.
Thank you.
Reply content:
I want to use swoole FOR A Message notification, such as a comment that has not been read, a private message...
Like on the official website, you are prompted at the top of the page that you have a few demands that have not accepted the answer.
Then I read swoole. We can use the latest WebSocket feature of html5 to do this. It is simple to consider that WebSocket does not support ie browsers. I don't know if there is a better way to achieve compatibility using swoole.
Thank you.
Swoole can be used as a gateway to support persistent connections, HTTP polling, websocket, and Redis as a query service.
Segmentfault uses ajax regular polling
You can try PHPSocket. IO. The interface is super simple and compatible with all browsers.
Swoole or wokerman is used as the socket server, and socket. io. js is used at the front end. The advantage is that it will be automatically compatible,
There is no problem with swoole. I just hope that the landlord can dedicate the code to git after it is done. Because the entire swoole environment document is lacking and the actual case is lacking, many people are discouraged.
Incompatible with websocket, not related to swoole Service
You can also directly use the Redis-only mode. When a new request is published, Redis publishes this message. After receiving the message, the client subscribing to this channel prompts on the interface.
In IE, the frontend introduces socket. io to implement automatic downgrade, which is not very complex and does not need to be changed in the backend logic.
First, I wonder what kind of business requires such real-time notifications,
Second, from the technical implementation, if only IE does not support it, you can use flash, and the market is basically doing this.
Of course there are other solutions, such as wokerman mentioned above, and swoole