Definitely skip a poll if a previous call has not returned..

 

I poll every 15 minutes in general, but if a client has "pending
business", then I increase that clients polling frequency, and return it
to normal frequency when the business is completed.

 

I have to whine a bit here and say here that my polling solution was a
last minute change.  I had built the app using sockets and had
essentially zero latency, but the client changed the network topology at
the last minute and their IT people were unable to open my socket
access, so with less than two weeks to drop-dead go-live, I implemented
polling.  It still hurts, but there is no funding to make another go at
socket connection, especially when the client is quite happy with the
status quo.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Josh McDonald
Sent: Wednesday, October 22, 2008 7:14 PM
To: [email protected]
Subject: Re: [flexcoders] Re: How to keep Tree control synchronized with
the database. Please Help

 

I'd start the timer only when a successful result returns, and then I'd
set it for (pollingFrequencyDelay + Math.round(Math.random() *
lastResponseTime)) each time, so as to slow things down a little when
it's under load.

-Josh

On Thu, Oct 23, 2008 at 8:50 AM, Paul Andrews <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

Just one more word of caution. The timer MUST allow enough time for the
server to complete the request that you have asked of it. The last thing
that you want is to stack up requests to the server. Ideally in this
timer environment you won't make a request to the server while the last
request hasn't yet completed.

 

Bit harder than at first sight, isn't it?

 

Paul

        ----- Original Message ----- 

        From: Paul Andrews <mailto:[EMAIL PROTECTED]>  

        To: [email protected]
<mailto:[email protected]>  

        Sent: Wednesday, October 22, 2008 11:39 PM

        Subject: Re: [flexcoders] Re: How to keep Tree control
synchronized with the database. Please Help

         

        A word of caution Anuj.

         

        I don't know if your timer works once a second or once a minute,
or once every two minutes. If you have only one online user, it's not
too huge a deal either way. If you have a hundred users you can cause
big problems for your server. The timer technique just makes the best of
a bad job. Usually a lot of care is taken over database and query design
to minimise the impact of large numbers of users. Unfortunately the
timer technique gives the server a lot of work even when the number of
users is quite small.

         

        Remember a timer on the client just affects one user and there's
usually processor power to spare. A timer in conjunction with a server
database access stresses the server. It stresses the server a lot.

         

        End of cautionary note.

         

        Paul

                ----- Original Message ----- 

                From: anuj sharma <mailto:[EMAIL PROTECTED]>  

                To: [email protected]
<mailto:[email protected]>  

                Sent: Wednesday, October 22, 2008 11:31 PM

                Subject: Re: [flexcoders] Re: How to keep Tree control
synchronized with the database. Please Help

                 

                Bingo Guys
                Thats' exactly what i need. Tracy's Timer example works
perfect for me.
                Again thanks a lot for your help.
                Anuj

                On Wed, Oct 22, 2008 at 2:29 PM, john fisher
<[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote:

                Anuj
                
                I meant, "search through the online adobe docs for
'timer polling
                example' or other keywords like those."
                
                there are many many examples in the online docs at
Adobe.
                
                John

                
                
                anuj sharma wrote:
                > Hi John
                > I am not sure i get what you are trying to say. Can
you be please elaborate
                > little bit more.
                > Thanks
                > Anuj
                >
                > On Wed, Oct 22, 2008 at 10:13 AM, john fisher
<[EMAIL PROTECTED] <mailto:john%40jpfisher.net> > wrote:
                >
                > 
                >> @mark: thanks will check it out
                >> @anuj:
                >> this is just exactly what the adobe sample code does,
except not
                >> directly to the database.
                >>
                >> anuj sharma wrote:
                >> 
                >>> ... Can I use the Timer class to create a timer
instance
                >>> 
                >>> which will periodically call HTTP a
                >>> 
                >> 
                >>
                >> 
                >
                > 

                
                
                




-- 
"Therefore, send not to know For whom the bell tolls. It tolls for
thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
:: http://flex.joshmcdonald.info/ <http://flex.joshmcdonald.info/> 

 

Reply via email to