Periodically perform a task.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Periodically perform a task.

Paul DeBruicker
Hi -

I access a service that would like their users to limit requests to one
per second.  Using Pharo if I haven't sent a request in the past second
it sends immediately, and if I have it waits however many milliseconds
are left using a Delay, then sends the request.


In Gemstone, this sometimes results in an attempt to commit a Semaphore,
which results in a "Error # 2407, Objects of this type cannot be
commited".


Is there a safe way to do it in Gemstone?  Are Delays ever OK in Gemstone?

I'm already using the ServiceVM to perform some tasks and imagine I
might need one that just checks an RCQueue, performs the time
calculation, and then either waits or sends the request.

Thanks

Paul
Reply | Threaded
Open this post in threaded view
|

Re: Periodically perform a task.

Dale Henrichs
On 03/03/2011 07:33 AM, Paul DeBruicker wrote:
> Hi -
>
> I access a service that would like their users to limit requests to one
> per second.  Using Pharo if I haven't sent a request in the past second
> it sends immediately, and if I have it waits however many milliseconds
> are left using a Delay, then sends the request.

There are bugs see:

   http://code.google.com/p/glassdb/issues/detail?id=123

the bug was actually fixed in the vm and in smalltalk last summer in a
post 2.4.4.1 release, but the workaround mentioned in the bug should fix
the problem if you are interested in delaying the response.

If you are not delaying the response then the service vm is the way to go...

Dale
Reply | Threaded
Open this post in threaded view
|

Re: Periodically perform a task.

Dale Henrichs
On 03/03/2011 11:29 AM, Dale Henrichs wrote:

> On 03/03/2011 07:33 AM, Paul DeBruicker wrote:
>> Hi -
>>
>> I access a service that would like their users to limit requests to one
>> per second.  Using Pharo if I haven't sent a request in the past second
>> it sends immediately, and if I have it waits however many milliseconds
>> are left using a Delay, then sends the request.
>
> There are bugs see:
>
>     http://code.google.com/p/glassdb/issues/detail?id=123
>
> the bug was actually fixed in the vm and in smalltalk last summer in a
> post 2.4.4.1 release, but the workaround mentioned in the bug should fix
> the problem if you are interested in delaying the response.

I double checked when the bug was fixed and it looks like the bug was
actually fixed in 2.4.4.

>
> If you are not delaying the response then the service vm is the way to go...
>
> Dale