On Tue Mar 23 19:38:52 +0100 2010, tcn wrote:
> I don't get it, can somebody explain what I am doing wrong?

You try to delete a job which is not in the tube. This happens, because
..

>             final long jobId = client.put(0, 0, 5, "hello world".getBytes());

... you first put the job with a time-to-run (TTR) of 5 seconds, ...

>                     final Job job = client.reserve(null);

... then reserve the job, which removes it from the tube. Note that your
workers neither delete nor release the job; due to this fact, the jobs
will be re-added to the tube after the TTR expires.

>         Thread.sleep(1000);

Then you wait for a second, which is far below your TTR of 5 seconds, so
the jobs won't have been re-added after that.

>             boolean b = client.delete(jobId);

Finally you try to delete a job by ID, only that this job does not exist
in the tube, as it is still reserved and the reservation has not yet
timed out.

Hope that helps.

-- 
Regards,
Andreas

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

Reply via email to