how to remove a tube?

1,503 views
Skip to first unread message

ffernand

unread,
Nov 3, 2009, 12:07:59 PM11/3/09
to beanstalk-talk
i've been reading protocol.txt of beanstalkd and trying beanstalk via
beanstalkc (python library). I'm growing quite fond of this little
message queue. It's a great piece of work with easy to read source
code. Thanks....

One question though...

Is there a way to remove a tube. Or at least completely clear it
out? So far, the only way I can think of is to reserve and delete all
the jobs in a tube, which could be thousands. I have a use-case where
the submitted jobs need to be invalidated.

It's not a big problem to clear the queue via repeated reserve and
delete, but it seems clunky.

filipe

Lindsay Holmwood

unread,
Nov 3, 2009, 1:33:26 PM11/3/09
to beansta...@googlegroups.com
2009/11/3 ffernand <fferna...@gmail.com>:

>
> i've been reading protocol.txt of beanstalkd and trying beanstalk via
> beanstalkc (python library).  I'm growing quite fond of this little
> message queue.  It's a great piece of work with easy to read source
> code.  Thanks....
>
> One question though...
>
> Is there a way to remove a tube.  Or at least completely clear it
> out?  So far, the only way I can think of is to reserve and delete all
> the jobs in a tube, which could be thousands.  I have a use-case where
> the submitted jobs need to be invalidated.

From my reading of the docs + code, and vague chattering with others
on Twitter, there is nothing in the beanstalkd protocol or
implementation that lets you do this.

I would love to be proved wrong - I have a need for this sort of
functionality and have considered patching it in.

Cheers,
Lindsay


--
http://holmwood.id.au/~lindsay/ (me)

Dan Mayer

unread,
Nov 3, 2009, 1:56:36 PM11/3/09
to beansta...@googlegroups.com
I would also like a clear-tube or delete tube function added. As I
have had to add a reserve and delete all jobs on the queue function a
couple times.

Just wanted to up the vote for this feature request.

peace,
Dan Mayer
Co-founder, Devver.net (http://devver.net)
http://twitter.com/devver
http://mayerdan.com
http://twitter.com/danmayer

Keith Rarick

unread,
Nov 3, 2009, 6:22:32 PM11/3/09
to beansta...@googlegroups.com
http://github.com/kr/beanstalkd/issues/#issue/25

The only problem with this is that freeing n jobs is O(n). I prefer
all commands to run in O(log n).

It'd have to remove the jobs without freeing them, then free them
incrementally later. There might even be a trick somewhere in there to
eliminate the time spent freeing them...

kr

Carl

unread,
Dec 4, 2009, 12:51:05 PM12/4/09
to beanstalk-talk
We've been using Beanstalk in an unusual way: as a messaging server,
and guess what, it's working better than RabbitMQ for us :)

Being able to remove tubes would *really* benefit us. Is there some
sort of ETA on this, is it even planned?

Thanks!

Carl

Rob Davies

unread,
Dec 4, 2009, 3:05:41 PM12/4/09
to beansta...@googlegroups.com
I'm a fan of the simplicity of Beanstalk - something I would like to
do is promote even wider adoption of the protocol by implementing a
Beanstalk plugin to the Apache ActiveMQ broker - so that tasks could
be optionally persistent, and there could be interchange between
ActiveMQ Queues and Beanstalk workqueues.

I'm interested to gauge feedback to see if this would be an
abomination or if you guys think it would be useful. I'm keen not step
on anyones toes here!

cheers,

Rob

Rob Davies
http://twitter.com/rajdavies
I work here: http://fusesource.com
My Blog: http://rajdavies.blogspot.com/
I'm writing this: http://www.manning.com/snyder/





Keith Rarick

unread,
Dec 4, 2009, 6:35:31 PM12/4/09
to beansta...@googlegroups.com
On Fri, Dec 4, 2009 at 9:51 AM, Carl <cmer...@gmail.com> wrote:
> We've been using Beanstalk in an unusual way: as a messaging server,
> and guess what, it's working better than RabbitMQ for us :)

Awesome. I guess simplicity has its advantages.

> Being able to remove tubes would *really* benefit us. Is there some
> sort of ETA on this, is it even planned?

Yes, this ability is necessary internally for mailboxes to work, so we
might as well expose it in the protocol. This will be in version 1.5,
but I have no estimate on when that will happen.

kr

Keith Rarick

unread,
Dec 4, 2009, 9:36:37 PM12/4/09
to beansta...@googlegroups.com
On Fri, Dec 4, 2009 at 12:05 PM, Rob Davies <rajd...@gmail.com> wrote:
> I'm a fan of the simplicity of Beanstalk - something I would like to
> do is promote even wider adoption of the protocol by implementing a
> Beanstalk plugin to the Apache ActiveMQ broker - so that tasks could
> be optionally persistent, and there could be interchange between
> ActiveMQ Queues and Beanstalk workqueues.

Just to see if I understand, you want to teach ActiveMQ to act like a
beanstalk server?

> I'm interested to gauge feedback to see if this would be an
> abomination or if you guys think it would be useful. I'm keen not step
> on anyones toes here!

Don't worry about that. :) I think it would be interesting. Most
likely, you'll find all sorts of problems in the protocol doc. Right
now, it is mostly *descriptive* of the server, rather than
*prescriptive*, so it is probably full of ambiguity. So I guess I
would selfishly encourage you to proceed, because I look forward to
getting lots of bug reports. :)

kr

Rob Davies

unread,
Dec 5, 2009, 3:40:17 AM12/5/09
to beansta...@googlegroups.com
On 5 Dec 2009, at 02:36, Keith Rarick wrote:

On Fri, Dec 4, 2009 at 12:05 PM, Rob Davies <rajd...@gmail.com> wrote:
I'm a fan of the simplicity of Beanstalk - something I would like to
do is promote even wider adoption of the protocol by implementing a
Beanstalk plugin to the Apache ActiveMQ broker - so that tasks could
be optionally persistent, and there could be interchange between
ActiveMQ Queues and Beanstalk workqueues.

Just to see if I understand, you want to teach ActiveMQ to act like a
beanstalk server?
Yes!


I'm interested to gauge feedback to see if this would be an
abomination or if you guys think it would be useful. I'm keen not step
on anyones toes here!

Don't worry about that. :) I think it would be interesting. Most
likely, you'll find all sorts of problems in the protocol doc. Right
now, it is mostly *descriptive* of the server, rather than
*prescriptive*, so it is probably full of ambiguity. So I guess I
would selfishly encourage you to proceed, because I look forward to
getting lots of bug reports. :)

kr

Great! - I'll get started,

cheers,

Rob

--

You received this message because you are subscribed to the Google Groups "beanstalk-talk" group.
To post to this group, send email to beansta...@googlegroups.com.
To unsubscribe from this group, send email to beanstalk-tal...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en.








Hung Tran

unread,
Dec 5, 2009, 6:09:33 PM12/5/09
to beanstalk-talk
It's interesting Rob. End of the day i like something that's simple.
And I also want something that is powerful. The two doesnt often go
well together :P


On Dec 4, 12:05 pm, Rob Davies <rajdav...@gmail.com> wrote:
> I'm a fan of the simplicity of Beanstalk - something I would like to  
> do is promote even wider adoption of the protocol by implementing a  
> Beanstalk plugin to the Apache ActiveMQ broker - so that tasks could  
> be optionally persistent, and there could be interchange between  
> ActiveMQ Queues and Beanstalk workqueues.
>
> I'm interested to gauge feedback to see if this would be an  
> abomination or if you guys think it would be useful. I'm keen not step  
> on anyones toes here!
>
> cheers,
>
> Rob
>
> Rob Davieshttp://twitter.com/rajdavies

Hung Tran

unread,
Dec 5, 2009, 6:08:12 PM12/5/09
to beanstalk-talk
Interesting - whats the numbers as far as messages you're moving. And
whats the throughput?
I sorta stop looking at the rabbitMQ when I saw the installation
steps :)

Rob Davies

unread,
Dec 6, 2009, 3:00:18 AM12/6/09
to beansta...@googlegroups.com
I agree Hung - even though we will constantly strive to make activemq
even easier to use - I don't envisage supporting Beanstalk in ActiveMQ
means that it would be seen as an alternative to beanstalkd. I'm
looking at this from the other way, providing an alternative queueing
model that is simple to use - as opposed to either the JMS/NMS or
STOMP apis that are already available to the existing ActiveMQ
community. Hopefully they'd be some healthy cross over between the
two communities too.

cheers,

Rob
> --
>
> You received this message because you are subscribed to the Google
> Groups "beanstalk-talk" group.
> To post to this group, send email to beansta...@googlegroups.com.
> To unsubscribe from this group, send email to beanstalk-tal...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en
> .
>
>

Rob Davies
Reply all
Reply to author
Forward
0 new messages