> There is a timer running.
On Jan 30, 8:34 pm, "gwoodho...@gmail.com" <gwoodho...@gmail.com>
wrote:
> > There is a timer running.
>
[quoted text clipped - 12 lines]
>
> Graeme
Hi,
thanks for your replies.
>make periodic requests to the server (via AJAX is
Well, thats the point. Assume 5 browsers have established a session
with the web server.
now 1 of them has bid his amount, whcih is, changed the current price
value. THIS, can be posted to the server.Also can be done using AJAX.
However, I would also want to update the rest of the 4 browsers with
the latest update of the price.
> Why not create a javascript timer, one that sends a request to a
> servlet every few seconds/minutes (depending on your capacity/server
> load). In this way the response could give the value of the field you
> need.
The seconds part is what I also thought about; because this is a
auction site and all users got to be updated asap. However, I am
afraid, I dont know if it is a good solution.
Wont it increase the traffic, slow down the performance and restrict
the number of users I can have ?
I have heard a lot of stock tickers work the same way. Any clue on how
they function ?
thanks
Lew - 31 Jan 2008 14:50 GMT
> On Jan 30, 8:34 pm, "gwoodho...@gmail.com" <gwoodho...@gmail.com>
> wrote:
[quoted text clipped - 24 lines]
> However, I would also want to update the rest of the 4 browsers with
> the latest update of the price.
Right. Did you have a question there? Why wouldn't Graeme's suggestion work
for you?
The basic pattern for a resource manager (your server manages the resource of
common knowledge) is to have it answer only, and let the resource consumers be
request only.
The resource manager "holds" the request until it has an answer. So on the
"status" channel all /n/ clients request session status, but do not get an
answer right away. When one of the clients makes a change (a new bid), it
pushes the change on the "change" channel. The server then answers all /n/
requests for status with the new data over their respective "status" request
channels. When the clients receive their status data, they immediately make a
new request for the next status over their respective "status" channels.
Continue until shampoo bottle is empty.

Signature
Lew
public void washHair( ShampooBottle bottle ) throws EmptyBottleException
{
do { wash(); rinse(); } while ( repeat );
}
Daniel Pitts - 01 Feb 2008 01:52 GMT
> On Jan 30, 8:34 pm, "gwoodho...@gmail.com" <gwoodho...@gmail.com>
> wrote:
[quoted text clipped - 41 lines]
>
> thanks
Also look into cometd.
It is an AJAX like technology that lets you "push" values to the
clients.
In practice though, you should make every attempt to inform the
customer that the value has changed, but don't assume that they were
informed before they made an action (the value could have changed
between the time they pressed the mouse button and the browser
registered it).
Buddha - 01 Feb 2008 08:52 GMT
> Also look into cometd.
> It is an AJAX like technology that lets you "push" values to the
> clients.
Thanks. am gonna take a look at it now.
>Right. Did you have a question there? Why wouldn't Graeme's suggestion work
for you
I did :
> slow down the performance and restrict
>the number of users I can have ?
>I have heard a lot of stock tickers work the same way. Any clue on how
>they function ?
I guess am gonna go with Graeme's solution.
> > > Graeme
@ Graeme : Thanks. I am gonna follow this thing. Just that, I will
have to change the refresh rate too as the timer ticks towards zero,
the refresh rate gets higher.
thanks again.
Rgds