Well if you're familiar with Design Patterns 
(http://www.amazon.com/exec/obidos/ASIN/0201633612/) you might want to use 
the Command pattern.

Putting "commands" on a queue and then throttling them is basically equivalent 
to throttling method calls.


An alternative approach, which avoids queues and the command patter:  just 
have a timer object that issues method calls at set intervals.


HTH,

DR

On Tuesday 21 January 2003 10:11 am, you wrote:
> Hi David
>
> I think that's the answer but instead of objects I want to put a method
> call on a queue and execute them at suitable intervals. I suspect I am
> going to have to create proxy objects to put in the queue that understand
> their own parameters, return values and timeouts. It would be nice if you
> could queue a function call.
>
> Best regards,
>
> Andrew
>
>
> -----Original Message-----
> From: David Rosenstrauch [mailto:[EMAIL PROTECTED]]
> Sent: 21 January 2003 15:02
> To: JDJList
> Subject: [jdjlist] Re: Slowing down processing
>
> * put the objects in a queue
> * write a "throttle" class that takes them from the queue and sends them
> along
> at a constant rate
>
> HTH,
>
> DR
>
> On Tuesday 21 January 2003 09:22 am, you wrote:
> > Hi Madhav
> >
> > Unfortunately 'synchronized' will only stop calls being made at the same
> > time. But it won't help if the processing is going too fast; I need to
> > space the calls out even if the "client " sends them together(very
> > closely together)
> >
> > Regards
> >
> > Andrew
> >
> > -----Original Message-----
> > From: Madhav Vodnala [mailto:[EMAIL PROTECTED]]
> > Sent: 21 January 2003 12:27
> > To: JDJList
> > Subject: [jdjlist] Re: Slowing down processing
> >
> >
> > Hi Andrew
> >
> > If am not wrong you are trying to solve a typical client server problem,
> > wherein
> > the client calls to server have to be controlled and
> > ONE AND ONLY ONE call is to execute (say reading/writing from/to the
>
> server
>
> > stream )
> > at any given fraction of time towards its(call) completion or timeout.
> >
> > The solution is to understand the usage of 'synchronized' keyword.
> >
> > Thanks
> > Madhav Vodnala
> >
> >
> > ----- Original Message -----
> > From: "Andrew Rendle" <[EMAIL PROTECTED]>
> > To: "JDJList" <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 21, 2003 4:30 PM
> > Subject: [jdjlist] Slowing down processing
> >
> > | Good Morning All
> > |
> > | I have a processing problem that means commands can be issued to fast
>
> for
>
> > my
> >
> > | processing server.
> > |
> > | I have an API, a list of methods, which perform various actions on a
> >
> > server
> >
> > | object.
> > |
> > | I need to be able to make sure there is a minimum gap between requests
> >
> > also
> >
> > | each function needs to either complete or timeout.
> > |
> > | What I would prefer not to do is convert each function call into a
> > | command list with parameters and then have a long else if structure to
> > | decode and action the requested method. What I really want is to
> > | control the
> >
> > execution
> >
> > | of each API call
> > |
> > | I know it sound a little confused but does anyone understand what I am
> > | trying to do and is it possible?
> > |
> > | Cheers
> > |
> > | Andrew
> > |
> > |
> > |
> > | ____________________________________________________
> > | To change your JDJList options, please visit:
> > | http://www.sys-con.com/java/list.cfm
> > |
> > | Be respectful! Clean up your posts before replying
> > | ____________________________________________________
> >
> > ____________________________________________________
> > To change your JDJList options, please visit:
> > http://www.sys-con.com/java/list.cfm
> >
> > Be respectful! Clean up your posts before replying
> > ____________________________________________________
> >
> >
> >
> > ____________________________________________________
> > To change your JDJList options, please visit:
> > http://www.sys-con.com/java/list.cfm
> >
> > Be respectful! Clean up your posts before replying
> > ____________________________________________________
>
> ____________________________________________________
> To change your JDJList options, please visit:
> http://www.sys-con.com/java/list.cfm
>
> Be respectful! Clean up your posts before replying
> ____________________________________________________
>
>
>
> ____________________________________________________
> To change your JDJList options, please visit:
> http://www.sys-con.com/java/list.cfm
>
> Be respectful! Clean up your posts before replying
> ____________________________________________________


____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to