/** * 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; }
/** * 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); }
public function lrem($key, $count, $value) { return $this->client->lrem($key, $count, $value); }