本文整理汇总了PHP中Predis\Client::srem方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::srem方法的具体用法?PHP Client::srem怎么用?PHP Client::srem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Predis\Client
的用法示例。
在下文中一共展示了Client::srem方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeFromSet
public function removeFromSet($key, $value)
{
if (!is_array($value)) {
$value = array($value);
}
return $this->_client->srem($key, $value);
}
示例2: unsetRegistryValue
/**
* @param $namespaceKey
*/
private function unsetRegistryValue($namespaceKey)
{
if (($key = array_search($namespaceKey, $this->registeredStates, true)) !== false) {
unset($this->registeredStates[$key]);
}
$this->redis->srem(self::STATE_MACHINE_NAMESPACE . 'registry', $namespaceKey);
}
示例3: waitAndReserve
/**
* Wait for a message in the queue and save the message to a safety queue
*
* TODO: Idea for implementing a TTR (time to run) with monitoring of safety queue. E.g.
* use different queue names with encoded times? With brpoplpush we cannot modify the
* queued item on transfer to the safety queue and we cannot update a timestamp to mark
* the run start time in the message, so separate keys should be used for this.
*
* @param int $timeout
* @return \Flowpack\JobQueue\Common\Queue\Message
*/
public function waitAndReserve($timeout = NULL)
{
if ($timeout === NULL) {
$timeout = $this->defaultTimeout;
}
try {
$value = $this->client->brpoplpush("queue:{$this->name}:messages", "queue:{$this->name}:processing", $timeout);
} catch (\Exception $e) {
$this->waitAndReserve();
}
if (is_string($value)) {
$message = $this->decodeMessage($value);
if ($message->getIdentifier() !== NULL) {
$this->client->srem("queue:{$this->name}:ids", $message->getIdentifier());
}
return $message;
} else {
return NULL;
}
}
示例4: removeFromList
/**
* @inheritdoc
*/
public function removeFromList($list, $value)
{
return $this->predis->srem($list, $value) > 0;
}
示例5: remove
/**
* Remove identifier from set
* @param $identifier
* @return int
*/
public function remove($identifier)
{
return $this->redisClient->srem($this->setName, $identifier);
}
示例6: unsubscribe
/**
* Removes the command from the subscription set.
*
* @param string $commandName
*/
public function unsubscribe($commandName)
{
$this->client->srem(sprintf(self::COMMAND_SUBSCRIPTION_KEY, $this->hashCommandName($commandName)), [$this->nodeName]);
}
示例7: unfollow
/**
* @param int $userId
*/
private function unfollow($userId)
{
$this->redisClient->srem("uid:" . $userId . ":followers", [$this->sessionUserId]);
$this->redisClient->srem("uid:" . $this->sessionUserId . ":following", [$userId]);
}
示例8: removeFromSet
/**
* @param int $keyId
* @param int $searchId
* @return $this;
*/
private function removeFromSet($keyId, $searchId)
{
$this->redis->srem($this->getFormattedKey($keyId), $searchId);
return $this;
}