本文整理汇总了PHP中GearmanWorker::echo方法的典型用法代码示例。如果您正苦于以下问题:PHP GearmanWorker::echo方法的具体用法?PHP GearmanWorker::echo怎么用?PHP GearmanWorker::echo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GearmanWorker
的用法示例。
在下文中一共展示了GearmanWorker::echo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
if (!($memcache = new Memcache($offLogCfg['memcache']['ip'], $offLogCfg['memcache']['port']))) {
die(date("F j, Y, g:i a") . " Coudn't connect to Memcache");
} else {
echo date("F j, Y, g:i a") . " Connected to Memcache\n";
}
/**
* The gearman worker instance
*
* @var unknown_type
*/
$worker = new GearmanWorker();
/**
* Add the default server, don't use config as worker is run locally
* to gearman server atm, so no config defaults to localhost
*/
if (!$worker->addServer() or !$worker->echo("ping")) {
die(date("F j, Y, g:i a") . " Can't connect to gearman server\n");
} else {
echo date("F j, Y, g:i a") . " Connected to Gearman Server\n";
}
/**
* Add the logging functions
*/
if (!$worker->addFunction("logSimple", "logSimple_cd")) {
die(date("F j, Y, g:i a") . "Couldn't add function :: logSimple");
} else {
echo date("F j, Y, g:i a") . " Function added :: logSimple\n";
}
/**
* All set up, now start the worker
*/