source/Redis/Connection.php
public function transaction(Closure $Commands, $mode = Redis::MULTI) {
        try {
            $Instance = $this->multi($mode);
            $result = $Commands($Instance);
            if ($result == true) {
                return $Instance->exec();
            } else {
                $Instance->discard();
                return false;
            }
        } catch (RedisException $ex) {
            throw new ConnectException();
        }
    }
public function transaction(Closure $Commands, $mode = Redis::MULTI) {
        try {
            $Instance = $this->multi($mode);
            $result = $Commands($Instance);
            if ($result == true) {
                return $Instance->exec();
            } else {
                $Instance->discard();
                return false;
            }
        } catch (RedisException $ex) {
            throw new ConnectException();
        }
    }
public function transaction ( Closure $ Commands , $ mode = Redis :: MULTI ) { try { $ Instance = $ this -> multi ( $ mode ) ; $ result = $ Commands ( $ Instance ) ; if ( $ result == true ) { return $ Instance -> exec ( ) ; } else { $ Instance -> discard ( ) ; return false ; } } catch ( RedisException $ ex ) { throw new ConnectException ( ) ; } }
Execute transaction method
@param callable $Commands function, that have Redis instance as a first argument.
Must returns boolean value for execute or discard all commands
@param string $mode transaction mode
@return array|false transaction execution result or false on failure
Execute transaction method