本文整理汇总了PHP中Job::getRootJobParams方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::getRootJobParams方法的具体用法?PHP Job::getRootJobParams怎么用?PHP Job::getRootJobParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job::getRootJobParams方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doIsRootJobOldDuplicate
/**
* @see JobQueue::isRootJobOldDuplicate()
* @param Job $job
* @return bool
*/
protected function doIsRootJobOldDuplicate(Job $job)
{
if (!$job->hasRootJobParams()) {
return false;
// job has no de-deplication info
}
$params = $job->getRootJobParams();
$key = $this->getRootJobCacheKey($params['rootJobSignature']);
// Get the last time this root job was enqueued
$timestamp = $this->dupCache->get($key);
// Check if a new root job was started at the location after this one's...
return $timestamp && $timestamp > $params['rootJobTimestamp'];
}
示例2: doIsRootJobOldDuplicate
/**
* @see JobQueue::doIsRootJobOldDuplicate()
* @param Job $job
* @return bool
* @throws JobQueueError
*/
protected function doIsRootJobOldDuplicate(Job $job)
{
if (!$job->hasRootJobParams()) {
return false;
// job has no de-deplication info
}
$params = $job->getRootJobParams();
$conn = $this->getConnection();
try {
// Get the last time this root job was enqueued
$timestamp = $conn->get($this->getRootJobCacheKey($params['rootJobSignature']));
} catch (RedisException $e) {
$timestamp = false;
$this->throwRedisException($conn, $e);
}
// Check if a new root job was started at the location after this one's...
return $timestamp && $timestamp > $params['rootJobTimestamp'];
}
示例3: doDeduplicateRootJob
protected function doDeduplicateRootJob( Job $job ) {
$params = $job->getRootJobParams();
$partitions = $this->partitionPushRing->getLocations( $params['rootJobSignature'], 2 );
try {
return $this->partitionQueues[$partitions[0]]->doDeduplicateRootJob( $job );
} catch ( JobQueueError $e ) {
if ( isset( $partitions[1] ) ) { // check fallback partition
return $this->partitionQueues[$partitions[1]]->doDeduplicateRootJob( $job );
}
}
return false;
}
示例4: doIsRootJobOldDuplicate
protected function doIsRootJobOldDuplicate(Job $job)
{
$params = $job->getRootJobParams();
$sigature = $params['rootJobSignature'];
$partition = $this->partitionRing->getLiveLocation($sigature);
try {
return $this->partitionQueues[$partition]->doIsRootJobOldDuplicate($job);
} catch (JobQueueError $e) {
if ($this->partitionRing->ejectFromLiveRing($partition, 5)) {
$partition = $this->partitionRing->getLiveLocation($sigature);
return $this->partitionQueues[$partition]->doIsRootJobOldDuplicate($job);
}
}
return false;
}