<i id='jQiM6'><tr id='jQiM6'><dt id='jQiM6'><q id='jQiM6'><span id='jQiM6'><b id='jQiM6'><form id='jQiM6'><ins id='jQiM6'></ins><ul id='jQiM6'></ul><sub id='jQiM6'></sub></form><legend id='jQiM6'></legend><bdo id='jQiM6'><pre id='jQiM6'><center id='jQiM6'></center></pre></bdo></b><th id='jQiM6'></th></span></q></dt></tr></i><div id='jQiM6'><tfoot id='jQiM6'></tfoot><dl id='jQiM6'><fieldset id='jQiM6'></fieldset></dl></div>
  • <tfoot id='jQiM6'></tfoot>

    <small id='jQiM6'></small><noframes id='jQiM6'>

          <bdo id='jQiM6'></bdo><ul id='jQiM6'></ul>
      1. <legend id='jQiM6'><style id='jQiM6'><dir id='jQiM6'><q id='jQiM6'></q></dir></style></legend>

      2. 每秒查询表以获取通知.这是一个好习惯吗?

        query table every second for notification. Is it a good practice?(每秒查询表以获取通知.这是一个好习惯吗?)

        <i id='buYyF'><tr id='buYyF'><dt id='buYyF'><q id='buYyF'><span id='buYyF'><b id='buYyF'><form id='buYyF'><ins id='buYyF'></ins><ul id='buYyF'></ul><sub id='buYyF'></sub></form><legend id='buYyF'></legend><bdo id='buYyF'><pre id='buYyF'><center id='buYyF'></center></pre></bdo></b><th id='buYyF'></th></span></q></dt></tr></i><div id='buYyF'><tfoot id='buYyF'></tfoot><dl id='buYyF'><fieldset id='buYyF'></fieldset></dl></div>
          <tbody id='buYyF'></tbody>

        • <bdo id='buYyF'></bdo><ul id='buYyF'></ul>

          <tfoot id='buYyF'></tfoot>

            • <legend id='buYyF'><style id='buYyF'><dir id='buYyF'><q id='buYyF'></q></dir></style></legend>

                <small id='buYyF'></small><noframes id='buYyF'>

                  本文介绍了每秒查询表以获取通知.这是一个好习惯吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个具有通知功能的项目,我想出了一个关于如何实时获取通知的想法.我的想法是每秒查询一次表.我有一个通知表,所以每当客户端添加一些东西时,它都会插入到通知表中,然后另一个客户端通过查询来获取通知.我使用 ajax 来做到这一点.

                  I have a project that has notification functionality and I came up with an idea on how to get a notification real time. My idea is to query the table every second. I have a notification table, so whenever the client is adding something it will insert to the notification table and then the other client gets the notification by querying it. I use ajax to do this.

                  每秒查询一次表是好还是不好的编程习惯?我只在 localhost 中使用它,这很好.当网站上线时,这种想法会产生负面影响吗?

                  Is it good to query the table every second or it's bad programming practice? I only use this in localhost and it's fine. Do this kind of idea affect negatively when the site goes live?

                  预先感谢您的回答.

                  推荐答案

                  每秒 ping 一次数据库并不是实现此目的的理想方式;您可以实现数据库触发器和 HTML5 websockets/推送通知的组合:http://html5hacks.com/blog/2013/04/21/push-notifications-to-the-browser-with-server-sent-events/

                  Pinging the DB every second is not the ideal way to do this; you can implement a combination of DB triggers and HTML5 websockets/push notifications: http://html5hacks.com/blog/2013/04/21/push-notifications-to-the-browser-with-server-sent-events/

                  http://www.abrandao.com/2013/06/25/websockets-using-modern-html5-technology-for-true-server-push/

                  http://pusher.com/tutorials/html5_realtime_push_notifications

                  这篇关于每秒查询表以获取通知.这是一个好习惯吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <legend id='3OE3v'><style id='3OE3v'><dir id='3OE3v'><q id='3OE3v'></q></dir></style></legend>

                    <tbody id='3OE3v'></tbody>
                    <bdo id='3OE3v'></bdo><ul id='3OE3v'></ul>
                    <i id='3OE3v'><tr id='3OE3v'><dt id='3OE3v'><q id='3OE3v'><span id='3OE3v'><b id='3OE3v'><form id='3OE3v'><ins id='3OE3v'></ins><ul id='3OE3v'></ul><sub id='3OE3v'></sub></form><legend id='3OE3v'></legend><bdo id='3OE3v'><pre id='3OE3v'><center id='3OE3v'></center></pre></bdo></b><th id='3OE3v'></th></span></q></dt></tr></i><div id='3OE3v'><tfoot id='3OE3v'></tfoot><dl id='3OE3v'><fieldset id='3OE3v'></fieldset></dl></div>
                    • <small id='3OE3v'></small><noframes id='3OE3v'>

                          <tfoot id='3OE3v'></tfoot>