I'm intermediate in Beanstalk + Pheanstalk. I'm developing my core part (background process) using Beanstalk. It's excellent tool that's no doubt but I'm stuck in one situation. I'm using beanstalk using Yii framework.
Let's say, I have two jobs A (Tube - A-Jobs) and B (Tube - B-Jobs) and both are under different tube and workers. B is dependent on A. It may possible that B will fetch first by worker before A and will start process on it. In that case, I need B to delay for some seconds (120 secs) untill A will execute.
As per my knowledge, there isn't any direct way to make job delay. For this you need to delete job B and put back to same queue with delay time. Correct me if I'm wrong here.
Now situation is that, I'm not able to get actual tube name in that case, because pheanstalk only providing Job Id and Job Data. I'm pasting you my code below,
$pheanstalkA = Yii::app()->beanstalk->getClient($client);
$pheanstalkA->watch('A-tube');
$pheanstalkB = Yii::app()->beanstalk->getClient($client);
$pheanstalkB->watch('B-tube');
Now, if I got any job using reserve function,
$jobB = $pheanstalkB->reserve();
It will give you output as follow, and we can see that beanstalk is not providing tube name from which it fetched this job.
Pheanstalk_Job Object
(
[_id:Pheanstalk_Job:private] => 2
[_data:Pheanstalk_Job:private] => Job Data ....
)
As we know that, single worker can watch in N tube(s), so if I want to delay this job and want to put under same tube. How can we find job's tube name?
Thanks...