views:

1550

answers:

4

I want to be able to push prices to a web interface as they become available (rather than having to be requested each time).

I have spent hours looking for tutorials on Google. However I cannot seem to find anything that holds the hand, they all tend to be descriptions of how Comets work.

Can you recommend a tutorial, or set of tutorials or book(s) that cover this technology. Preferably using a Java app deployed on a tomcat server or something similar.

If you could outline the basic steps that would be just as helpful.

+1  A: 

I kept a log of the commands I used to get a test instance of comet running on Jetty using Maven. It's not really a tutorial, but it might help you get some examples up and running:

Getting started with comet

There's not much out there for comet tutorials and each one you find seems to be for different methodologies and technologies; making it even more confusing. My best recommendation is to follow the steps in my link, get the server running and explore some of the examples that come with the Jetty server, they aren't hugely complicated and, while the code is messy, at least they're an ok start.

If you're curious, you can also browse the code located in my google repo. The game.js file in particular uses comet technology that I wrote based on the examples in Jetty.

Steerpike
Thanks, appreciate it.
Ankur
+2  A: 

I found StreamHub Comet Server quite useful, if you download the SDK they have an example that does exactly what you need - pushing prices to a web page. They also have some links to getting started guide in the SDK. As far as books go, none really go in to much detail, Ajax Patterns by Michael Mahemoff covers some of the basic Comet techniques such as long-polling and hidden iframe but doesn't really give any real world code examples.

Supertux
A: 

Here's a simple example that does exactly what you need (pushing prices to the client via comet) using WebSync and ExtJS. It's got a full description of what's going on behind the scenes.

http://www.frozenmountain.com/libdemos/extjs%5Fdemo.aspx

jvenema
A: 

You may refer the following link. It has a working example of Comet. http://cometdaily.com/2008/02/12/%E2%80%9Chello-world%E2%80%9D-with-lightstreamer/

Eager Learner