xobotyi/beansclient - пхп клиент сервера очереди beanstalkd без зависимостей
useTube('myAwesomeTube')
->put("job's payload");
## ##
# WORKER #
## ##
$job = $beansClient->watchTube('myAwesomeTube')
->reserve();
if ($job->id) {
echo "Hey, i received first {$job->payload} of job with id {$job->id}\n";
$job->delete();
echo "And i've done it!\n";
}
else {
echo "So sad, i have nothing to do";
}
echo "Am I still connected? \n" . ($beansClient->getConnection()->isActive() ? 'Yes' : 'No') . "\n";
Поделиться в
Facebook
Мой мир
Вконтакте
Одноклассники
Google+