Re: cancelling queued items
[email protected] ((Justin Mason)) Wed, 21 Mar 2007 15:49:00 +0000
| Newsgroups | perl.ipc.dirqueue |
|---|---|
| Message-ID | <[email protected]> |
Brian Duggan writes:
> Hello,
>
> I'm using IPC::DirQueue -- very nice module, thanks.
>
> I wanted the ability to cancel not-yet-active items from
> anywhere in the queue (a la lprm), and was trying
> to think of a safe way to do it. It occurred to me
> that one easy modification to IPC::DirQueue that would
> allow this would be to have pickup_queued_job() take
> an optional parameter which is the name of the data path,
> and then just add something like
>
> next if exists($args{datapath}) &&
> $nextfile ne $args{datapath};
>
> to the while loop.
>
> Any chance this could be incorporated? Or is there
> already another safe way to cancel an item?
It sounds pretty good -- just one thing -- how is a caller supposed to get
the datapath? Presumably they don't construct it themselves...
> thanks
> Brian
>
> (p.s. happy to send a patch if you prefer)
that's ok, that suggestion is a one-liner. Having said that -- a test case
"t" script would rock though :)
--j.