job cancellation

77 views
Skip to first unread message

Mark Dufour

unread,
Dec 11, 2019, 11:00:58 AM12/11/19
to beanstalk-talk
hi,

(please forgive any wrong terminology in the following!)

I'm looking at using beanstalk as a job queue, where it should be possible to cancel (specific) running jobs. this kind of leads one to think of adding a separate 'control' tube for each worker, as well as an extra thread in each worker to monitor the extra tube. of course that seems a bit of a hack....

some other "message brokers" seem to offer broadcasting functionality, but it's all a bit unclear what the precise options and tradeoffs are. and I like beanstalk so far, so perhaps anyone here has been here before..?


thanks, cheers,
mark.

Chad Kouse

unread,
Dec 11, 2019, 11:36:14 AM12/11/19
to beansta...@googlegroups.com
I think trying to stop a running job using beanstalk is going to be a hack no matter how you go at it.  I see 2 paths here -- 

1 -- the job is in the queue and you want to stop it from ever starting -- this I would probably handle with some kind of state machine -- a simple table in a database for example.  Pick up the job - as first step check this db table for any cancellation  message - if it's there, delete the cancellation message (if applicable) and don't run the job.

2 -- The job has left the queue and is already running and you need to cancel it.  This seems like you'd need some watchdog process to check for cancellation messages coming in and asking jobs to quit / rollback / etc.

Either way I don't think beanstalk is your tool here.

--
You received this message because you are subscribed to the Google Groups "beanstalk-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beanstalk-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beanstalk-talk/8c6873d8-34cd-47f9-905d-3c76a5f54ea7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages