Is there a way to delete a tube? or empty it?

8,525 views
Skip to first unread message

BeagleGuy

unread,
Jul 19, 2010, 9:20:27 PM7/19/10
to beanstalk-talk
Curious if there was a way to delete whats in a tube? For example
during testing stages there may be times I load up data in the wrong
format or I'm experimenting with different formats. Currently I'm
restarting beanstalk at the loss of the other tubes. Is there a way to
empty a single tube out?

thanks

Zhu Han

unread,
Jul 19, 2010, 10:21:31 PM7/19/10
to beansta...@googlegroups.com
If you delete all messages in the tube, the empty tube will be wiped out automatically.

best regards,
hanzhu



--
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.


BeagleGuy

unread,
Jul 20, 2010, 12:39:41 PM7/20/10
to beanstalk-talk
I didn't see a command for that from the docs in the python client..
what command might that be?

On Jul 19, 7:21 pm, Zhu Han <schumi....@gmail.com> wrote:
> If you delete all messages in the tube, the empty tube will be wiped out
> automatically.
>
> best regards,
> hanzhu
>
>
>
> On Tue, Jul 20, 2010 at 9:20 AM, BeagleGuy <jimi...@gmail.com> wrote:
> > Curious if there was a way to delete whats in a tube? For example
> > during testing stages there may be times I load up data in the wrong
> > format or I'm experimenting with different formats. Currently I'm
> > restarting beanstalk at the loss of the other tubes. Is there a way to
> > empty a single tube out?
>
> > thanks
>
> > --
> > 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<beanstalk-talk%2Bunsubscribe@go oglegroups.com>
> > .

Cody Caughlan

unread,
Jul 20, 2010, 12:55:26 PM7/20/10
to beansta...@googlegroups.com
BeagleGuy-

The command is just the normal 'delete' command which you issue after
you've successfully processed a job.

If you're using pybeanstalkd at:

http://github.com/sophacles/pybeanstalk/blob/master/beanstalk/job.py

Then its the "Finish" method on job.py (as an aside I would argue the
method should be called 'delete' since thats what the Beanstalkd
command is - it is kind of confusing to have that differentiation).

/Cody

> To unsubscribe from this group, send email to beanstalk-tal...@googlegroups.com.

BeagleGuy

unread,
Jul 20, 2010, 2:34:38 PM7/20/10
to beanstalk-talk
thanks Cody, will that delete an entire queue or just one job in the
queue? I'm looking to actually empty an entire tube of jobs to
basically start fresh

ether

unread,
Jul 20, 2010, 2:54:29 PM7/20/10
to beanstalk-talk
The "easiest" way to do this currently is to peek at every job in the
ready,
buried and delayed queues, and then delete them, in a loop.

It would definitely be handy to have a "flush-tube <tube name>"
command.

Cody Caughlan

unread,
Jul 20, 2010, 2:54:22 PM7/20/10
to beansta...@googlegroups.com
That method is run on single Job. If you wanted to delete a tube that
has jobs in it then you will have to iterate over every Job and
Finish() it - after you Finish() the last Job from that tube then
Beanstalkd will automagically delete the actual tube.

/Cody

Karen Etheridge

unread,
Jul 20, 2010, 1:32:26 PM7/20/10
to beansta...@googlegroups.com

The "easiest" way to do this currently is to peek at every job in the ready,
buried and delayed queues, and then delete them, in a loop.

It would definitely be handy to have a "flush-tube <tube name>" command.


On Tue, Jul 20, 2010 at 09:55:26AM -0700, Cody Caughlan wrote:
> BeagleGuy-
>
> The command is just the normal 'delete' command which you issue after

> you've successfully processed a job...

--
"Given a choice between dancing pigs and security, users will
pick dancing pigs every time." - Ed Felten, Princeton University
. . . . .
Karen Etheridge, ka...@etheridge.ca GCS C+++$ USL+++$ P+++$ w--- M++
http://etheridge.ca/ PS++ PE-- b++ DI++++ e++ h(-)

Reply all
Reply to author
Forward
0 new messages