本文整理汇总了PHP中Job::name方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::name方法的具体用法?PHP Job::name怎么用?PHP Job::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Job
function do_post_testcancelphp_continuation_v1($job, $resp)
{
// we have do_post with a continuation of do_finish. The do_finish
// is only called via on-completion handler for do_run
$run = $this->job_manager()->job("do_run_testcancelphp_continuation_v1");
$finish = new Job($job);
$finish->name("do_finish_testcancelphp_continuation_v1");
$run->on(Job::EVENT_COMPLETED, $finish);
$this->afterwards($run);
return Worker::WORKER_CONTINUE;
}
示例2: Job
function do_get_testchainedphp_hello_v1($job, $resp)
{
$content = json_encode("Hello from job");
// do internal hello1 which just appends it name to our content
$j = new Job($job);
$j->name("do_get_internalphp_hello1_v1");
$j->type(Job::JOB_SYNC);
$j->content($content);
$r = $j->run();
// create sync http rest job back to localhost which takes
// the output from previous job and adds its own name.
$j = $this->job_manager()->job(HttpClient::METHOD_POST, $job->base_uri() . "/hello2");
$j->content($r->content());
$j->headers($r->headers());
$r = $j->run();
$resp->content($r->content());
$resp->headers($r->headers());
return Worker::WORKER_SUCCESS;
}
示例3: equals
/**
* @param Job $job
*
* @return bool
*/
public function equals(Job $job)
{
return $this->name() === $job->name() && $this->arguments() === $job->arguments();
}