寻找使用 PHP 进行实时推送通知的更好选择
我想实现从 php 到我的项目的实时推送通知。我已经测试了两种可能的方法。
- 长轮询mysql数据库->性能非常差,因为查询很大,
- 长时间轮询内存缓存并通过 php 推送 ->性能不佳的
- Ajax Push 引擎 ->似乎不太容易实现...但是带有 PHP 集成
有谁知道更好的方法吗? 也许有一些类似于memcache的东西可以推送?
I want to implement real time push notifications from php to my project. i already testet 2 possible ways.
- long polling the mysql database -> very poor performance, cause the query is big
- long polling memcache and push via php -> poor performance
- Ajax Push Engine -> seems not so easy to come along with... but comes with PHP integration
Does anyone know a better way?
Maybe there is some similar to memcache which alows Pushing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Pusher(我为之工作)等托管服务可能是一个不错的解决方案。我们提供 JavaScript 库供您嵌入您的网页和 REST API(以及易于使用的PHP 发布者库),以便您可以将数据从您自己的服务器推送到您的网页中。
我还整理了其他实时技术的列表,以便您可以查看您可能可用的其他选项。
A hosted service such as Pusher (who I work for) might be a good solution for you. We offer a JavaScript library for you to embed in your web pages and a REST API (and an easy to use PHP publisher library) so you can push data from your own servers and into your web pages.
I've also put together a list of other real-time technologies so you can have a look at the other options that might be available to you.