PHPDaemon\Clients\Memcache\Pool::delete PHP Method

delete() public method

Deletes the key
public delete ( string $key, callable $onResponse = null, integer $time ) : void
$key string Key
$onResponse callable Callback called when the request complete
$time integer Time to block this key
return void
    public function delete($key, $onResponse = null, $time = 0)
    {
        $this->getConnectionByKey($key, function ($conn) use($key, $time, $onResponse) {
            if (!$conn->connected) {
                return;
            }
            if ($onResponse !== null) {
                $conn->onResponse->push($onResponse);
                $conn->checkFree();
            }
            $conn->writeln('delete ' . $this->config->prefix->value . $key . ' ' . $time);
        });
    }