Search code examples
yii2resquebeanstalkd

Is it possible to plain Beanstalkd task at some time?


I use Beantalkd and Yii2 framework. To add in queue I use something like this:

        Yii::$app->beanstalk
          ->putInTube('tube2', ['param' => 'val'], PheanstalkInterface::DEFAULT_PRIORITY, PheanstalkInterface::DEFAULT_DELAY);

But now I need to plain some task right at specified time, is it possible with Beantalkd, or I need something like Resque?


Solution

  • You can play some task at a sepcified time by calculating the delay, and sending that as a parameter to your above example.

    On the other hand, it would be good to store time based lists for example in Redis, and have a cron that reads the expired ones every minute and loads the jobs to beanstalkd.