public function prepend($key, $value, $exp = 0, $onResponse = null)
    {
        $this->getConnectionByKey($key, function ($conn) use ($key, $value, $exp, $onResponse) {
            if (!$conn->connected) {
                return;
            }
            if ($onResponse !== null) {
                $conn->onResponse->push($onResponse);
                $conn->setFree(false);
            }
            $conn->writeln('prepend ' . $this->config->prefix->value . $key . ' 0 ' . $exp . ' ' . mb_orig_strlen($value)
                . ($onResponse === null ? ' noreply' : '') . "\r\n" . $value);
        });
    }
public function prepend($key, $value, $exp = 0, $onResponse = null)
    {
        $this->getConnectionByKey($key, function ($conn) use ($key, $value, $exp, $onResponse) {
            if (!$conn->connected) {
                return;
            }
            if ($onResponse !== null) {
                $conn->onResponse->push($onResponse);
                $conn->setFree(false);
            }
            $conn->writeln('prepend ' . $this->config->prefix->value . $key . ' 0 ' . $exp . ' ' . mb_orig_strlen($value)
                . ($onResponse === null ? ' noreply' : '') . "\r\n" . $value);
        });
    }
public function prepend ( $ key , $ value , $ exp = 0 , $ onResponse = null ) { $ this -> getConnectionByKey ( $ key , function ( $ conn ) use ( $ key , $ value , $ exp , $ onResponse ) { if ( ! $ conn -> connected ) { return ; } if ( $ onResponse !== null ) { $ conn -> onResponse -> push ( $ onResponse ) ; $ conn -> setFree ( false ) ; } $ conn -> writeln ( 'prepend ' . $ this -> config -> prefix -> value . $ key . ' 0 ' . $ exp . ' ' . mb_orig_strlen ( $ value ) . ( $ onResponse === null ? ' noreply' : '' ) . "\r\n" . $ value ) ; } ) ; }
Prepends a string to the key's value
@param  string $key Key
@param  string $value Value
@param  integer $exp Lifetime in seconds (0 - immortal)
@param  callable $onResponse Callback called when the request complete
@callback $onResponse ( )
@return void
Prepends a string to the key s value