本文整理匯總了PHP中Predis\Client::lrem方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::lrem方法的具體用法?PHP Client::lrem怎麽用?PHP Client::lrem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Predis\Client
的用法示例。
在下文中一共展示了Client::lrem方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: finish
/**
* Mark a message as finished
*
* @param \Flowpack\JobQueue\Common\Queue\Message $message
* @return boolean TRUE if the message could be removed
*/
public function finish(\Flowpack\JobQueue\Common\Queue\Message $message)
{
$originalValue = $message->getOriginalValue();
$success = $this->client->lrem("queue:{$this->name}:processing", 0, $originalValue) > 0;
if ($success) {
$message->setState(\Flowpack\JobQueue\Common\Queue\Message::STATE_DONE);
}
return $success;
}
示例2: removeAssociation
/**
* Immediately delete association from Redis.
*/
function removeAssociation($server_url, $handle)
{
// create Redis keys
$serverKey = $this->associationServerKey($server_url);
$associationKey = $this->associationKey($server_url, $handle);
// Removing the association from the server's association list
$removed = $this->redis->lrem($serverKey, 0, $associationKey);
if ($removed < 1) {
return false;
}
// Delete the association itself
return $this->redis->del($associationKey);
}
示例3: lrem
public function lrem($key, $count, $value)
{
return $this->client->lrem($key, $count, $value);
}