Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiuser editing in a complicated page using server push

I'm using Zend Framework for an application called Pricetag, and we're thinking of adding support for real-time multi-user editing. Basically the idea is, in each of 4 steps, to be able to share what you're editing with other online users (much like Pivotal Tracker or Trello does).

This is a screenshot of the most complicated (programmatically speaking) of the four pages we have:

Pricetag Step 2 screenshot

Internal HTML is not important (but hey, you can register as a free user if you want to check it out), basically some inputs and the ability to add/delete these blocks ("deliverables" and "tasks") with javascript.

I assume I need some way for the server to notify each online client about changes in the page. I'm already doing a request every time you change something (the white block on the right updates every time you do so), but I don't know exactly how other users would receive that information.

Polling the server every 5 seconds or so seems very very wrong. The site uses PHP, is that enough to do it? Should I interface with a separate script in the server? Is there a Zend Framework module already built that I'm missing even though I asked Google first?

like image 586
cambraca Avatar asked Nov 15 '11 23:11

cambraca


1 Answers

Try this comet server - http://dklab.ru/lib/dklab_realplexor/

It's has PHP and javascript API, see the sandbox for examples - http://rutwit.ru/realplexor/demo

Comet server written in perl, the source and tarball files are available here - http://github.com/DmitryKoterov/dklab_realplexor/tarball/master

see other technologies -

Tornado Web Server. Web server writed on Python, it's not onlye comet server - it's a framework where you can create a comet server.

NginxHttpPushModule: simple module for nginx web server, that adds support for Comet.

CometD: scalable HTTP-based event routing bus that uses a Ajax Push. Supported subscribe on many channels.

APE: It's rather a framework for building the comet-systems than finished product.

Stardust - simple COMET server in perl (comment of author — "the simplest COMET server I could imagine").

Orbited: emulation of TCP sockets in JavaScript.

like image 179
Anton P Robul Avatar answered Oct 26 '22 18:10

Anton P Robul