public function failure()
    {
        $this->failures[] = time();

        // Clean old failures:
        $now = time();
        $cooldownBound = $now - $this->cooldown;
        foreach ($this->failures as $i => $time) {
            if ($time < $cooldownBound) {
                unset($this->failures[$i]);
            }
        }

        if ($this->isOpen()) {
            $this->fireEvent(self::CLOSED, self::OPEN);
        }

        return $this->write();
    }