library/Rediska/Command/ShiftFromListBlocking.php
public function create($keyOrKeys, $timeout = 0)
    {
        if (!is_array($keyOrKeys)) {
            $keys = array($keyOrKeys);
        } elseif (!empty($keyOrKeys)) {
            $keys = $keyOrKeys;
        } else {
            throw new Rediska_Command_Exception('Not present keys for shift');
        }

        $connections = array();
        $keysByConnections = array();
        foreach ($keys as $key) {
            $connection = $this->_rediska->getConnectionByKeyName($key);
            $connectionAlias = $connection->getAlias();
            if (!array_key_exists($connectionAlias, $connections)) {
                $connections[$connectionAlias] = $connection;
                $keysByConnections[$connectionAlias] = array();
            }
            $keysByConnections[$connectionAlias][] = $key;
        }

        // TODO: Implement for many connections
        if (count($keysByConnections) > 1) {
            throw new Rediska_Command_Exception("Blocking shift until worked only with one connection. Try to use Rediska#on() method for specify it.");
        }

        $execs = array();
        foreach($keysByConnections as $connectionAlias => $keys) {
            $command = array('BLPOP');
            foreach($keys as $key) {
                $command[] = $this->_rediska->getOption('namespace') . $key;
            }
            $command[] = $timeout;

            $execs[] = new Rediska_Connection_Exec($connections[$connectionAlias], $command);
        }

        return $execs;
    }
public function create($keyOrKeys, $timeout = 0)
    {
        if (!is_array($keyOrKeys)) {
            $keys = array($keyOrKeys);
        } elseif (!empty($keyOrKeys)) {
            $keys = $keyOrKeys;
        } else {
            throw new Rediska_Command_Exception('Not present keys for shift');
        }

        $connections = array();
        $keysByConnections = array();
        foreach ($keys as $key) {
            $connection = $this->_rediska->getConnectionByKeyName($key);
            $connectionAlias = $connection->getAlias();
            if (!array_key_exists($connectionAlias, $connections)) {
                $connections[$connectionAlias] = $connection;
                $keysByConnections[$connectionAlias] = array();
            }
            $keysByConnections[$connectionAlias][] = $key;
        }

        // TODO: Implement for many connections
        if (count($keysByConnections) > 1) {
            throw new Rediska_Command_Exception("Blocking shift until worked only with one connection. Try to use Rediska#on() method for specify it.");
        }

        $execs = array();
        foreach($keysByConnections as $connectionAlias => $keys) {
            $command = array('BLPOP');
            foreach($keys as $key) {
                $command[] = $this->_rediska->getOption('namespace') . $key;
            }
            $command[] = $timeout;

            $execs[] = new Rediska_Connection_Exec($connections[$connectionAlias], $command);
        }

        return $execs;
    }
Create command

@param string $keyOrKeys   Key name or array of names
@param string $timeout     Blocking timeout in seconds. Timeout disabled for default.
@return Rediska_Connection_Exec