You want to use swoole to send a message notification, such as a comment that has not been read or a private message.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.