当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::srem方法代码示例

本文整理汇总了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);
 }
开发者ID:Antevenio,项目名称:redis,代码行数:7,代码来源:Client.php

示例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);
 }
开发者ID:akentner,项目名称:incoming-ftp,代码行数:10,代码来源:StateMachine.php

示例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;
     }
 }
开发者ID:admaykin,项目名称:Admaykin.Jobqueue.Redis,代码行数:31,代码来源:RedisQueue.php

示例4: removeFromList

 /**
  * @inheritdoc
  */
 public function removeFromList($list, $value)
 {
     return $this->predis->srem($list, $value) > 0;
 }
开发者ID:savritsky,项目名称:cache,代码行数:7,代码来源:PredisDriver.php

示例5: remove

 /**
  * Remove identifier from set
  * @param $identifier
  * @return int
  */
 public function remove($identifier)
 {
     return $this->redisClient->srem($this->setName, $identifier);
 }
开发者ID:mikicaivosevic,项目名称:online-users,代码行数:9,代码来源:RedisStorage.php

示例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]);
 }
开发者ID:fcm,项目名称:GovernorFramework,代码行数:9,代码来源:RedisTemplate.php

示例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]);
 }
开发者ID:KrunoKnego,项目名称:Symfony-Twitter-Clone,代码行数:8,代码来源:RedisFollow.php

示例8: removeFromSet

 /**
  * @param int $keyId
  * @param int $searchId
  * @return $this;
  */
 private function removeFromSet($keyId, $searchId)
 {
     $this->redis->srem($this->getFormattedKey($keyId), $searchId);
     return $this;
 }
开发者ID:avelov,项目名称:techery_friends,代码行数:10,代码来源:RequestedFriendsService.php


注:本文中的Predis\Client::srem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。