web系统向所有用户推送一条消息,有什么好的设计方案?

WBOY
Release: 2016-06-06 20:45:19
Original
1038 people have browsed it

web系统向所有用户推送一条消息,像新浪微博给所用用户推送一条消息,怎么设计消息队列

回复内容:

web系统向所有用户推送一条消息,像新浪微博给所用用户推送一条消息,怎么设计消息队列

web服务器向客户端(浏览器)推送吗?如果是的话,有两种解决方案:一:客户端每隔一定时间轮询,二:使用WebSocket技术。

https://github.com/walkor/web-msg-sender看看这个是不是你想要的。
效果就是给所有在线用户实时发送消息。

http://pusher.com/
可以尝试这个服务, 基本的技术是如 @jinlong feng 所说的

可以判断一下 如果支持websocket就用websocket 不支持的话只能轮询了

你说的是移动端么?现成的百度云推送就可以了啊

往移动端简单,可以使用云推送,
web端始终没找到好的解决方案,也或者是知识优先

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!