You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Hakim Sadikali <ha...@tecgcorp.com> on 2012/02/16 23:14:05 UTC

Sling Event - Ordered Queue deleting

Hi All,

Quick question on the ordered queue for sling events.  If you have an event
that was started, but failed and has a retry delay of 3minutes (doesnt
really matter).  The thread will sleep for 3 minutes and try again.  What
if during that time, you want to delete the event?  At no point does it
appear as though the event goes back into the queue waiting to be popped
back out (thats because the thread is just told to sleep until its time is
up and its ready to restart).

Is a better implementation put the object back on the front of the queue
and tell the thread to sleep until the top object is ready to be
processed?  In the meantime someone could delete the top of the queue
object, and the next object in the queue could be processed.

Just want to confirm that once an event has started there is no way to
delete it.

Hakim

Re: Sling Event - Ordered Queue deleting

Posted by Carsten Ziegeler <cz...@apache.org>.
Hi,

actually this should work - when the queue sleeps, the node of the job
is not locked anymore, so the job can be removed from the repository.
Once the queue wakes up, it tries to run the job but finds out that
the node is gone from the repository.

Carsten

2012/2/16 Hakim Sadikali <ha...@tecgcorp.com>:
> Hi All,
>
> Quick question on the ordered queue for sling events.  If you have an event
> that was started, but failed and has a retry delay of 3minutes (doesnt
> really matter).  The thread will sleep for 3 minutes and try again.  What
> if during that time, you want to delete the event?  At no point does it
> appear as though the event goes back into the queue waiting to be popped
> back out (thats because the thread is just told to sleep until its time is
> up and its ready to restart).
>
> Is a better implementation put the object back on the front of the queue
> and tell the thread to sleep until the top object is ready to be
> processed?  In the meantime someone could delete the top of the queue
> object, and the next object in the queue could be processed.
>
> Just want to confirm that once an event has started there is no way to
> delete it.
>
> Hakim



-- 
Carsten Ziegeler
cziegeler@apache.org