Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You basically have two issues here:</p> <ol> <li><p>You want a browser to be able to receive asynchronous events from the web application server without polling in a tight loop.</p></li> <li><p>You want the web application to be able to receive asynchronous events from the database without polling in a tight loop.</p></li> </ol> <p><strong>For Problem #1</strong></p> <p>See these wikipedia links for the type of techniques I think you are looking for:</p> <ul> <li><a href="http://en.wikipedia.org/wiki/Comet_%28programming%29" rel="nofollow noreferrer">Comet</a></li> <li><a href="http://en.wikipedia.org/wiki/Reverse_Ajax" rel="nofollow noreferrer">Reverse AJAX</a></li> <li><a href="http://en.wikipedia.org/wiki/Push_technology#HTTP_server_push" rel="nofollow noreferrer">HTTP Server Push</a></li> </ul> <p>EDIT: 19 Mar 2009 - Just came across <a href="http://www.reversehttp.net/" rel="nofollow noreferrer">ReverseHTTP</a> which might be of interest for Problem #1.</p> <p><strong>For Problem #2</strong></p> <p>The solution is going to be specific to which database you are using and probably the database driver your server uses too. For instance, with <a href="http://www.postgresql.org/" rel="nofollow noreferrer">PostgreSQL</a> you would use <a href="http://www.postgresql.org/docs/8.3/interactive/sql-listen.html" rel="nofollow noreferrer">LISTEN</a> and <a href="http://www.postgresql.org/docs/8.3/interactive/sql-notify.html" rel="nofollow noreferrer">NOTIFY</a>. (And at the risk of being down-voted, you'd probably use database triggers to call the NOTIFY command upon changes to the table's data.)</p> <p>Another possible way to do this is if the database has <a href="http://www.postgresql.org/docs/8.3/interactive/spi.html" rel="nofollow noreferrer">an interface</a> to create stored procedures or triggers that link to a dynamic library (i.e., a DLL or .so file). Then you could write the server signalling code in <a href="http://www.postgresql.org/docs/8.3/interactive/triggers.html" rel="nofollow noreferrer">C or whatever</a>.</p> <p>On the same theme, some databases allow you to write stored procedures in languages such as <a href="http://www.postgresql.org/docs/8.3/interactive/external-pl.html" rel="nofollow noreferrer">Java, Ruby</a>, <a href="http://www.postgresql.org/docs/8.3/interactive/plpython.html" rel="nofollow noreferrer">Python</a> and <a href="http://www.postgresql.org/docs/8.3/interactive/external-pl.html" rel="nofollow noreferrer">others</a>. You might be able to use one of these (instead of something that compiles to a machine code DLL like C does) for the signalling mechanism.</p> <p>Hope that gives you enough ideas to get started.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload